Compare commits
No commits in common. "2f5bf48b42f464bb572ffa0f245dfde319c5565b" and "9a80850230d0783f16886ac4b1b35b6483796f79" have entirely different histories.
2f5bf48b42
...
9a80850230
7 changed files with 5 additions and 29 deletions
|
|
@ -58,7 +58,7 @@ const isReleased = (post) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const markdownItHashtag = (md) => {
|
const markdownItHashtag = (md) => {
|
||||||
const hashtagRegex = /^#([a-zA-Z][a-zA-Z0-9_\\\\/\-]*)(?![a-zA-Z0-9_-])/;
|
const hashtagRegex = /^#([a-zA-Z][a-zA-Z0-9_\\\\/]*)(?![a-zA-Z0-9_-])/;
|
||||||
|
|
||||||
const HASH_CODE = '#'.charCodeAt(0);
|
const HASH_CODE = '#'.charCodeAt(0);
|
||||||
const SPACE_CODE = ' '.charCodeAt(0);
|
const SPACE_CODE = ' '.charCodeAt(0);
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ description: Welcome to my website! I write about tech, politics, food, and hobb
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ post.url }}" class="post-card">
|
<a href="{{ post.url }}" class="post-card">
|
||||||
<h2>{{ post.data.title }}</h2>
|
<h2>{{ post.data.title }}</h2>
|
||||||
<time class="localizable-time" datetime="{{ post.data.createdAt | isoDateTime }}">{{ post.data.createdAt | dateTimeFormat }}</time>
|
<time datetime="{{ post.data.createdAt | dateTimeFormat }}">{{ post.data.createdAt | dateTimeFormat }}</time>
|
||||||
{% if post.data.description %}
|
{% if post.data.description %}
|
||||||
<p>{{ post.data.description }}</p>
|
<p>{{ post.data.description }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
@ -54,7 +54,6 @@ description: Welcome to my website! I write about tech, politics, food, and hobb
|
||||||
<li>
|
<li>
|
||||||
<a href="/recipe/{{ recipe.slug }}/" class="post-card">
|
<a href="/recipe/{{ recipe.slug }}/" class="post-card">
|
||||||
<h2>{{ recipe.data.newest.data.title }}</h2>
|
<h2>{{ recipe.data.newest.data.title }}</h2>
|
||||||
<time class="localizable-time" datetime="{{ recipe.data.newest.data.createdAt | isoDateTime }}">{{ recipe.data.newest.data.createdAt | dateTimeFormat }}</time>
|
|
||||||
{% if recipe.data.newest.data.description %}
|
{% if recipe.data.newest.data.description %}
|
||||||
<p>{{ recipe.data.newest.data.description }}</p>
|
<p>{{ recipe.data.newest.data.description }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ permalink: /posts/
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ post.url }}" class="post-card">
|
<a href="{{ post.url }}" class="post-card">
|
||||||
<h2>{{ post.data.title }}</h2>
|
<h2>{{ post.data.title }}</h2>
|
||||||
<time class="localizable-time" datetime="{{ post.data.createdAt | isoDateTime }}">{{ post.data.createdAt | dateTimeFormat }}</time>
|
<time datetime="{{ post.data.createdAt | dateTimeFormat }}">{{ post.data.createdAt | dateTimeFormat }}</time>
|
||||||
{% if post.data.description %}
|
{% if post.data.description %}
|
||||||
<p>{{ post.data.description }}</p>
|
<p>{{ post.data.description }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
|
|
@ -920,6 +920,4 @@ You can also use web tools that you can give a URL and it will clean it for you:
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
#privacy #tracking #surveillance #digital-rights #activism #data-collection #security
|
|
||||||
|
|
@ -21,7 +21,6 @@ permalink: /recipes/
|
||||||
<li>
|
<li>
|
||||||
<a href="/recipe/{{ slug }}/" class="post-card">
|
<a href="/recipe/{{ slug }}/" class="post-card">
|
||||||
<h2>{{ recipeData.newest.data.title }}</h2>
|
<h2>{{ recipeData.newest.data.title }}</h2>
|
||||||
<time class="localizable-time" datetime="{{ recipeData.newest.data.createdAt | isoDateTime }}">{{ recipeData.newest.data.createdAt | dateTimeFormat }}</time>
|
|
||||||
{% if recipeData.newest.data.description %}
|
{% if recipeData.newest.data.description %}
|
||||||
<p>{{ recipeData.newest.data.description }}</p>
|
<p>{{ recipeData.newest.data.description }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const { execSync } = require("child_process");
|
const { execSync } = require("child_process");
|
||||||
const { DateTime } = require("luxon");
|
|
||||||
|
|
||||||
const getSlugFromPath = (filePath) => {
|
const getSlugFromPath = (filePath) => {
|
||||||
// Normalize the path - remove leading ./ if present
|
// Normalize the path - remove leading ./ if present
|
||||||
|
|
@ -63,21 +62,6 @@ const getFileCreatedTime = (filePath) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const getFileCreatedDateTime = (filePath) => {
|
|
||||||
const gitTime = getGitCreatedTime(filePath);
|
|
||||||
if (gitTime) {
|
|
||||||
return DateTime.fromMillis(gitTime, { zone: 'utc' });
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
const stats = fs.statSync(filePath);
|
|
||||||
const time = stats.birthtime ?? stats.mtime;
|
|
||||||
return DateTime.fromJSDate(time, { zone: 'utc' });
|
|
||||||
} catch (e) {
|
|
||||||
return DateTime.utc();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const getVersion = (filePath) => {
|
const getVersion = (filePath) => {
|
||||||
const dirName = path.dirname(filePath)
|
const dirName = path.dirname(filePath)
|
||||||
|
|
||||||
|
|
@ -161,9 +145,6 @@ module.exports = {
|
||||||
isDraft: (data) => {
|
isDraft: (data) => {
|
||||||
return data.draft === true;
|
return data.draft === true;
|
||||||
},
|
},
|
||||||
createdAt: (data) => {
|
|
||||||
return getFileCreatedDateTime(data.page.inputPath);
|
|
||||||
},
|
|
||||||
permalink: (data) => {
|
permalink: (data) => {
|
||||||
const slug = getSlugFromPath(data.page.inputPath);
|
const slug = getSlugFromPath(data.page.inputPath);
|
||||||
const version = getVersion(data.page.inputPath);
|
const version = getVersion(data.page.inputPath);
|
||||||
|
|
|
||||||
3
tags.njk
3
tags.njk
|
|
@ -19,7 +19,7 @@ layout: base.njk
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ post.url }}" class="post-card">
|
<a href="{{ post.url }}" class="post-card">
|
||||||
<h2>{{ post.data.title }}</h2>
|
<h2>{{ post.data.title }}</h2>
|
||||||
<time class="localizable-time" datetime="{{ post.data.createdAt | isoDateTime }}">{{ post.data.createdAt | dateTimeFormat }}</time>
|
<time datetime="{{ post.date | dateTimeFormat }}">{{ post.date | dateTimeFormat }}</time>
|
||||||
{% if post.data.description %}
|
{% if post.data.description %}
|
||||||
<p>{{ post.data.description }}</p>
|
<p>{{ post.data.description }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
@ -36,7 +36,6 @@ layout: base.njk
|
||||||
<li>
|
<li>
|
||||||
<a href="/recipe/{{ recipe.data.recipeSlug }}/" class="post-card">
|
<a href="/recipe/{{ recipe.data.recipeSlug }}/" class="post-card">
|
||||||
<h2>{{ recipe.data.title }}</h2>
|
<h2>{{ recipe.data.title }}</h2>
|
||||||
<time class="localizable-time" datetime="{{ recipe.data.createdAt | isoDateTime }}">{{ recipe.data.createdAt | dateTimeFormat }}</time>
|
|
||||||
{% if recipe.data.description %}
|
{% if recipe.data.description %}
|
||||||
<p>{{ recipe.data.description }}</p>
|
<p>{{ recipe.data.description }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue