Skip to content

Commit

Permalink
fix template and seo stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
urbanophile committed Apr 26, 2024
1 parent f1a17fa commit 5954d8a
Show file tree
Hide file tree
Showing 16 changed files with 172 additions and 70 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ __pycache__/
.DS_Store

# node and js nonsense
node_modules/
node_modules/


.TODO
7 changes: 5 additions & 2 deletions content/pages/About.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
Title: About Me
Author: Matt Gibson
Summary: About me page
Save_as: index.html
Summary: I am a software and machine learning developer in Sydney, NSW, Australia. I like computing, data, machine learning and cooking.
Save_as: about.html



<!-- Save_as: index.html -->

I am a software and machine learning developer in [Sydney](http://en.wikipedia.org/wiki/Sydney), NSW, Australia. I like [computing](https://en.wikipedia.org/wiki/MOS_Technology_6502), [data](https://search.r-project.org/CRAN/refmans/vcd/html/HorseKicks.html), [machine learning](https://pytorch.org/) and [cooking](https://web.archive.org/web/20160210065535/http://www.seriouseats.com/the-food-lab/?ref=nav_main). I'm delighted by the scientific enterprise which allows us ["to see a World in a Grain of Sand"](https://www.poetryfoundation.org/poems/43650/auguries-of-innocence).

I'm also quite keen on gibbons 🐒.
Expand Down
3 changes: 2 additions & 1 deletion content/pages/CV.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Title: CV
Author: Matt Gibson
Summary: "Experienced professional seeking job opportunities. Specialisations in machine learning, computer vision, and data analysis. Ph.D. in Computer Vision and Machine Learning. Proficient in Python, Tensorflow, Pytorch, and more."
Summary: Experienced professional always open to opportunities. Ph.D. in Computer Vision and Machine Learning with practical experience.
Save_as: cv.html


Looking for work. My email can be found on my github commits.
Expand Down
6 changes: 3 additions & 3 deletions pelicanconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
SITEURL = "https://matthew-gibson.com"

MENUITEMS = [
("About", "/index.html"),
("CV", "/pages/CV.html"),
("About", "/about.html"),
("CV", "/cv.html"),
("Blog", "/category/blog.html"),
]
# ▼▼▼▼▼▼▼▼▼▼ OVERWRITTEN in publishconf.py ▼▼▼▼
Expand Down Expand Up @@ -98,7 +98,7 @@

# #### Plugins - Sitemap ####
SITEMAP = {
"format": "txt",
"format": "xml",
"priorities": {"articles": 0.5, "indexes": 0.5, "pages": 0.5},
"changefreqs": {"articles": "monthly", "indexes": "daily", "pages": "monthly"},
}
5 changes: 5 additions & 0 deletions publishconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@
SITEURL = "https://matthew-gibson.com"
RELATIVE_URLS = False
# DISPLAY_PAGES_ON_MENU = True

ANALYTICS = """<!-- Cloudflare Web Analytics -->
<script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "8ffcbdbd3968444b8a98497ce18aa242"}'></script>
<!-- End Cloudflare Web Analytics -->
"""
21 changes: 21 additions & 0 deletions themes/my-basic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# About this theme

Not really a theme, just web design really.

```
├── static
│ ├── css
│ └── images
└── templates
├── archives.html // to display archives
├── article.html // processed for each article
├── author.html // processed for each author
├── authors.html // must list all the authors
├── categories.html // must list all the categories
├── category.html // processed for each category
├── index.html // the index (list all the articles)
├── page.html // processed for each page
├── period_archives.html // to display time-period archives
├── tag.html // processed for each tag
└── tags.html // must list all the tags. Can be a tag cloud.
```
18 changes: 11 additions & 7 deletions themes/my-basic/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

--my-neo-grotesque: Inter, Roboto, 'Helvetica Neue', 'Arial Nova', 'Nimbus Sans', Arial, sans-serif;


--standard-border-radius: 5px;

--h1-font-size: 2em;
Expand Down Expand Up @@ -115,6 +114,7 @@ hr {
h1, h2, h3, nav {
font-family: var(--my-monospace-code);
}

nav a {
color: var(--text-secondary)
}
Expand Down Expand Up @@ -163,19 +163,23 @@ nav a:hover {

main a:link {
color: var(--text-link);
text-decoration: none;
text-decoration: underline;

}

main a:hover {
color: var(--primary-hover);
text-decoration: underline;
text-decoration-thickness: 0.1em;
main a:hover, main a:focus {
/* color: var(--primary-hover); */
/* text-decoration-thickness: 0.1em; */
text-decoration: none;

}

main a:visited {
color: var(--text-visited);
text-decoration: underline;
text-decoration-thickness: 0.1em;

/* text-decoration: underline; */
/* text-decoration-thickness: 0.1em; */
}


Expand Down
3 changes: 3 additions & 0 deletions themes/my-basic/templates/analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% if ANALYTICS %}
{{ ANALYTICS }}
{% endif %}
14 changes: 14 additions & 0 deletions themes/my-basic/templates/archives.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% extends "base.html" %}

{% block title %}{{ SITENAME|striptags }} - Archives{% endblock %}

{% block content %}
<h2>Archives for {{ SITENAME }}</h2>

<dl>
{% for article in dates %}
<dt>{{ article.locale_date }}</dt>
<dd><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></dd>
{% endfor %}
</dl>
{% endblock %}
5 changes: 5 additions & 0 deletions themes/my-basic/templates/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

{% block title %}{{ SITENAME|striptags }} - {{ article.title|striptags }}{% endblock %}

{% block meta_desc %}
<meta name="description" content="{{ article.summary|striptags }}" />
{% endblock meta_desc %}


{% block head %}
{{ super() }}

Expand Down
48 changes: 11 additions & 37 deletions themes/my-basic/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,58 +7,30 @@
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">

{% block meta_desc %}
{% if SITESUBTITLE %}
<meta name="description" content="{{ SITESUBTITLE }}" />
{% endif %}
{% endblock meta_desc %}


{% if STYLESHEET_URL %}
<link rel="stylesheet" type="text/css" href="{{ STYLESHEET_URL }}" />
{% endif %}


<!-- deviation from template -->
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/style.css" />
<!-- end deviation -->

<link rel="shortcut icon" type="image/jpg" href="{{ SITEURL }}/theme/images/favicon.ico">


{% include 'feeds.html' %}



{% if FEED_ALL_ATOM %}
<link
href="{{ FEED_DOMAIN }}/{% if FEED_ALL_ATOM_URL %}{{ FEED_ALL_ATOM_URL }}{% else %}{{ FEED_ALL_ATOM }}{% endif %}"
type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} Full Atom Feed" />
{% endif %}
{% if FEED_ALL_RSS %}
<link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_RSS_URL %}{{ FEED_ALL_RSS_URL }}{% else %}{{ FEED_ALL_RSS }}{% endif %}"
type="application/rss+xml" rel="alternate" title="{{ SITENAME|striptags }} Full RSS Feed" />
{% endif %}
{% if FEED_ATOM %}
<link href="{{ FEED_DOMAIN }}/{%if FEED_ATOM_URL %}{{ FEED_ATOM_URL }}{% else %}{{ FEED_ATOM }}{% endif %}"
type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} Atom Feed" />
{% endif %}
{% if FEED_RSS %}
<link href="{{ FEED_DOMAIN }}/{% if FEED_RSS_URL %}{{ FEED_RSS_URL }}{% else %}{{ FEED_RSS }}{% endif %}"
type="application/rss+xml" rel="alternate" title="{{ SITENAME|striptags }} RSS Feed" />
{% endif %}
{% if CATEGORY_FEED_ATOM and category %}
<link
href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_ATOM_URL %}{{ CATEGORY_FEED_ATOM_URL.format(slug=category.slug) }}{% else %}{{ CATEGORY_FEED_ATOM.format(slug=category.slug) }}{% endif %}"
type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} Categories Atom Feed" />
{% endif %}
{% if CATEGORY_FEED_RSS and category %}
<link
href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_RSS_URL %}{{ CATEGORY_FEED_RSS_URL.format(slug=category.slug) }}{% else %}{{ CATEGORY_FEED_RSS.format(slug=category.slug) }}{% endif %}"
type="application/rss+xml" rel="alternate" title="{{ SITENAME|striptags }} Categories RSS Feed" />
{% endif %}
{% if TAG_FEED_ATOM and tag %}
<link
href="{{ FEED_DOMAIN }}/{% if TAG_FEED_ATOM_URL %}{{ TAG_FEED_ATOM_URL.format(slug=tag.slug) }}{% else %}{{ TAG_FEED_ATOM.format(slug=tag.slug) }}{% endif %}"
type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} Tags Atom Feed" />
{% endif %}
{% if TAG_FEED_RSS and tag %}
<link
href="{{ FEED_DOMAIN }}/{% if TAG_FEED_RSS_URL %}{{ TAG_FEED_RSS_URL.format(slug=tag.slug) }}{% else %}{{ TAG_FEED_RSS.format(slug=tag.slug) }}{% endif %}"
type="application/rss+xml" rel="alternate" title="{{ SITENAME|striptags }} Tags RSS Feed" />
{% endif %}
{% endblock head %}
</head>

Expand Down Expand Up @@ -147,6 +119,8 @@
}
})
</script>

{% include 'analytics.html' %}
</body>

</html>
2 changes: 1 addition & 1 deletion themes/my-basic/templates/category.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "index.html" %}
{% extends "content_list.html" %}

{% block title %}{{ SITENAME|striptags }} - {{ category }} category{% endblock %}

Expand Down
30 changes: 30 additions & 0 deletions themes/my-basic/templates/content_list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{% extends "base.html" %}
{% block content %}
{% block content_title %}
<h2>All articles</h2>
{% endblock %}


{% for article in articles_page.object_list %}
<article>
<header>
<h3><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">{{
article.title }}</a></h3>
</header>
<section>{{ article.summary }}</section>
<footer>
<p>Published: <time datetime="{{ article.date.isoformat() }}"> {{ article.locale_date }} </time></p>
<address>By
{% for author in article.authors %}
<a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a>
{% endfor %}
</address>
</footer>
</article>
{% endfor %}

{% if articles_page.has_other_pages() %}
{% include 'pagination.html' %}
{% endif %}

{% endblock content %}
37 changes: 37 additions & 0 deletions themes/my-basic/templates/feeds.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{% if FEED_ALL_ATOM %}
<link
href="{{ FEED_DOMAIN }}/{% if FEED_ALL_ATOM_URL %}{{ FEED_ALL_ATOM_URL }}{% else %}{{ FEED_ALL_ATOM }}{% endif %}"
type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} Full Atom Feed" />
{% endif %}
{% if FEED_ALL_RSS %}
<link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_RSS_URL %}{{ FEED_ALL_RSS_URL }}{% else %}{{ FEED_ALL_RSS }}{% endif %}"
type="application/rss+xml" rel="alternate" title="{{ SITENAME|striptags }} Full RSS Feed" />
{% endif %}
{% if FEED_ATOM %}
<link href="{{ FEED_DOMAIN }}/{%if FEED_ATOM_URL %}{{ FEED_ATOM_URL }}{% else %}{{ FEED_ATOM }}{% endif %}"
type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} Atom Feed" />
{% endif %}
{% if FEED_RSS %}
<link href="{{ FEED_DOMAIN }}/{% if FEED_RSS_URL %}{{ FEED_RSS_URL }}{% else %}{{ FEED_RSS }}{% endif %}"
type="application/rss+xml" rel="alternate" title="{{ SITENAME|striptags }} RSS Feed" />
{% endif %}
{% if CATEGORY_FEED_ATOM and category %}
<link
href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_ATOM_URL %}{{ CATEGORY_FEED_ATOM_URL.format(slug=category.slug) }}{% else %}{{ CATEGORY_FEED_ATOM.format(slug=category.slug) }}{% endif %}"
type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} Categories Atom Feed" />
{% endif %}
{% if CATEGORY_FEED_RSS and category %}
<link
href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_RSS_URL %}{{ CATEGORY_FEED_RSS_URL.format(slug=category.slug) }}{% else %}{{ CATEGORY_FEED_RSS.format(slug=category.slug) }}{% endif %}"
type="application/rss+xml" rel="alternate" title="{{ SITENAME|striptags }} Categories RSS Feed" />
{% endif %}
{% if TAG_FEED_ATOM and tag %}
<link
href="{{ FEED_DOMAIN }}/{% if TAG_FEED_ATOM_URL %}{{ TAG_FEED_ATOM_URL.format(slug=tag.slug) }}{% else %}{{ TAG_FEED_ATOM.format(slug=tag.slug) }}{% endif %}"
type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} Tags Atom Feed" />
{% endif %}
{% if TAG_FEED_RSS and tag %}
<link
href="{{ FEED_DOMAIN }}/{% if TAG_FEED_RSS_URL %}{{ TAG_FEED_RSS_URL.format(slug=tag.slug) }}{% else %}{{ TAG_FEED_RSS.format(slug=tag.slug) }}{% endif %}"
type="application/rss+xml" rel="alternate" title="{{ SITENAME|striptags }} Tags RSS Feed" />
{% endif %}
31 changes: 14 additions & 17 deletions themes/my-basic/templates/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
{% extends "base.html" %}
{% block content %}
{% block content_title %}
<h2>All articles</h2>
<article>
<h1> Welcome to my homepage </h1>
{% endblock %}

<p>
👋 hi there, thanks for visiting. My name is Matt and I am a software / machine learning person in Sydney. I am an irregular blogger, this is mostly to order my thoughts.
</p>

{% for article in articles_page.object_list %}
<article>
<header>
<h3><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">{{
article.title }}</a></h3>
</header>
<section>{{ article.summary }}</section>
<footer>
<p>Published: <time datetime="{{ article.date.isoformat() }}"> {{ article.locale_date }} </time></p>
<address>By
{% for author in article.authors %}
<a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a>
{% endfor %}
</address>
</footer>
</article>
<p>The most recent mid content I wrote: </p>

<dl>
{% for article in dates[:4] %}
<dt>{{ article.locale_date }}</dt>
<dd><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></dd>
{% endfor %}
</dl>

</article>

{% if articles_page.has_other_pages() %}
{% include 'pagination.html' %}
Expand Down
7 changes: 6 additions & 1 deletion themes/my-basic/templates/page.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{% extends "base.html" %}
{% extends "content_list.html" %}
{% block html_lang %}{{ page.lang }}{% endblock %}

{% block title %}{{ SITENAME|striptags }} - {{ page.title|striptags }}{%endblock%}

{% block meta_desc %}
<meta name="description" content="{{ page.summary|striptags }}" />
{% endblock meta_desc %}


{% block head %}
{{ super() }}

Expand Down

0 comments on commit 5954d8a

Please sign in to comment.