Skip to content

Commit

Permalink
generated tags should be .md not .txt files (doh!)
Browse files Browse the repository at this point in the history
Also try to turn off tag placement in headers
  • Loading branch information
jschrier committed Jan 7, 2024
1 parent 0757c5d commit 13359f0
Show file tree
Hide file tree
Showing 114 changed files with 15 additions and 49 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ ehthumbs.db
Thumbs.db
images/2023/10/12/~$2023.10.12_inconsistent_entries_with_D_values.xlsx
tag/.txt
tag/.md
2 changes: 2 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

{%- include custom-head.html -%}

{% comment %}
{% if site.tags != "" %}
{% include collecttags.html %}
{% endif %}
{% endcomment %}
</head>
2 changes: 1 addition & 1 deletion _includes/navigation.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<nav>
<a href="/">Home</a>

</nav>
7 changes: 3 additions & 4 deletions _posts/2024-01-06-Finally-getting-tags-working.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ I finally got post tagging working in Jekyll...made more difficult by some non-s
- This also fixes another minor bug that I had been experiencing, where the titles of blog posts displayed using only first letter capitalizations. Now I know that this is because jekyll was getting the name from the file name, and inferring capitalization. But once we switch this, it fixes the display, which is nice. No links should be broken by this change.
- I've updated the Jekyll script accordingly
- I had my site configured so that posts go to `/blog/`. But Jason's doesn't do this, which causes a bunch of file path issues on links. These can be fixed by modifying the `_layouts` and `_includes` paths acccordingly. If I were going to do this over, I would just clone Jason or Qian's repo, delete all their posts, and just run with it. But I didn't want to break links I shared with others, so I modified it. So I guess I could do it over again by using a time machine to retrieve my own repo now :-)
- Both guys use a [python script](http://www.jasonemiller.org/2020/12/23/tagging-posts-in-jekyll-minima.html) to create all the little tag files that are needed. But you can just do this on the command line:
- Both guys use a [python script](http://www.jasonemiller.org/2020/12/23/tagging-posts-in-jekyll-minima.html) to create all the little tag files that are needed. But you can just do this on the command line (from within the `_posts` directory) on your local machine:

```
cd _posts
grep -h "^tags: " *.md | sed -e 's/tags: //;' | tr ' ' '\n' | sort | uniq | while read name; do echo "---\nlayout: tagpage\ntitle: \"Tag: $name\"\ntag: $name\nrobots: noindex\n---\n" > "../tag/${name}.txt"; done
grep -h "^tags: " *.md | sed -e 's/tags: //;' | tr ' ' '\n' | sort | uniq | while read name; do echo "---\nlayout: tagpage\ntitle: \"Tag: $name\"\ntag: $name\nrobots: noindex\n---\n" > "../tag/${name}.md"; done
```

(the `robots` line keeps them off the lawn of the index pages only)
- You'll need to run this periodically to update new tags that are present.
- You'll need to run this periodically to update new tags that are present. I put an `update_tags.sh` script into `_posts` to make this easy.
2 changes: 1 addition & 1 deletion _posts/update_tags.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
grep -h "^tags: " *.md | sed -e 's/tags: //;' | tr ' ' '\n' | sort | uniq | while read name; do echo "---\nlayout: tagpage\ntitle: \"Tag: $name\"\ntag: $name\nrobots: noindex\n---\n" > "../tag/${name}.txt"; done
grep -h "^tags: " *.md | sed -e 's/tags: //;' | tr ' ' '\n' | sort | uniq | while read name; do echo "---\nlayout: tagpage\ntitle: \"Tag: $name\"\ntag: $name\nrobots: noindex\n---\n" > "../tag/${name}.md"; done
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions tag/art.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ title: "Tag: art"
tag: art
robots: noindex
---

7 changes: 0 additions & 7 deletions tag/art.txt

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions tag/audio.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ title: "Tag: audio"
tag: audio
robots: noindex
---

7 changes: 0 additions & 7 deletions tag/audio.txt

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion tag/metablogging.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ layout: tagpage
title: "Tag: metablogging"
tag: metablogging
robots: noindex
---
---

7 changes: 0 additions & 7 deletions tag/metablogging.txt

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions tag/music.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ title: "Tag: music"
tag: music
robots: noindex
---

7 changes: 0 additions & 7 deletions tag/music.txt

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions tag/science.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ title: "Tag: science"
tag: science
robots: noindex
---

7 changes: 0 additions & 7 deletions tag/science.txt

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions tag/teaching.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ title: "Tag: teaching"
tag: teaching
robots: noindex
---

7 changes: 0 additions & 7 deletions tag/teaching.txt

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 13359f0

Please sign in to comment.