diff --git a/Gemfile.lock b/Gemfile.lock index 1ad878eb..9194d940 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -260,6 +260,7 @@ GEM PLATFORMS arm64-darwin-21 arm64-darwin-22 + arm64-darwin-23 x86_64-darwin-18 x86_64-linux diff --git a/README.md b/README.md index 65733b18..c85e2bde 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,11 @@ This repository is a Jekyll website that powers https://mathesar.org. It is host - [Local setup](#local-setup) - [Installation](#installation) - [Running locally](#running-locally) +- [Publishing to the Blog](#publishing-to-the-blog) + - [Creating a new blog post](#creating-a-new-blog-post) + - [Creating Author Pages](#creating-author-pages) + - [Creating Tag Pages](#creating-tag-pages) + - [Updating Author Pages](#updating-author-pages) @@ -31,6 +36,75 @@ This repository is a Jekyll website that powers https://mathesar.org. It is host ### Running locally -Run `bundle exec jekyll serve` +1. Run: -Browse to `http://localhost:4000/` + ``` + bundle exec jekyll serve --port 4000 --livereload + ``` + +1. Browse to http://localhost:4000/ + +## Publishing to the Blog + +To publish a new post on the Mathesar blog, follow these steps. + +### Creating a new blog post + +1. **Create a new Markdown file in the `_posts` directory.** The file name should follow this format: `YYYY-MM-DD-title-of-the-post.md`. + +2. **Fill out the front matter for your post.** At the beginning of your Markdown file, include the following: + + ```yaml + --- + layout: post + title: "Title of Your Post" + tags: tag1 tag2 tag3 + date: YYYY-MM-DD + author: author_id + description: "Brief description of the post." + image: /path/to/featured/image.jpg + --- + ``` + +3. **Write your blog post.** After the front matter, use regular Markdown syntax to write your post. + +### Creating Author Pages + +If author_id does not exist in `_data/authors.yml`: + +1. **Add author details to `_data/authors.yml`.** If your author ID does not exist, create a new entry with your details. + + ```yaml + your_author_id: + name: Author Name + role: Author Role + bio: > + "A brief bio about the author. This can be a few sentences long." + image: /path/to/your/image.jpg + ``` + +### Creating Tag Pages + +If you've added new tags: + +1. **Run the tag generator script.** From the root directory, execute: + + ``` + python scripts/tag_generator.py + ``` + +This will generate pages for the new tags. + +### Updating Author Pages + +If you've added yourself as a new author: + +1. **Run the author generator script.** From the root directory, execute: + + ``` + python scripts/author_generator.py + ``` + +This will generate a page for your author profile. + +Remember to run the above scripts if you're introducing new tags or authors to ensure the website accurately reflects these changes. diff --git a/_config.yml b/_config.yml index e9e32108..e46c2f27 100644 --- a/_config.yml +++ b/_config.yml @@ -34,6 +34,7 @@ baseurl: "" url: "https://mathesar.org" # the base hostname & protocol for your site, e.g. http://example.com twitter_username: mathesar_org github_username: mathesar +permalink: /blog/:categories/:year/:month/:day/:title:output_ext # Build settings theme: minima diff --git a/_data/authors.yml b/_data/authors.yml new file mode 100644 index 00000000..493533c6 --- /dev/null +++ b/_data/authors.yml @@ -0,0 +1,12 @@ +sean_colsen: + name: Sean Colsen + role: Engineer at Mathesar + bio: > + Sean Colsen is an engineer on the Mathesar Maintainers team, focusing mostly on front end work. As a self-taught coder, he's been building cool stuff with web tech since 2007. + image: /assets/sean.jpg +kriti_godey: + name: Kriti Godey + role: Project Lead at Mathesar + bio: > + Kriti Godey is the project lead of Mathesar and works on most aspects of the project. She first started working on open source as head of engineering at Creative Commons, and worked at various startups before that. + image: /assets/kriti.jpg \ No newline at end of file diff --git a/_includes/author_details.html b/_includes/author_details.html new file mode 100644 index 00000000..983edf92 --- /dev/null +++ b/_includes/author_details.html @@ -0,0 +1,18 @@ +
+
+

{{ include.author.name }}

+

+ {{include.author.role}} +

+
+
+ {{ include.author.name }} +
+

{{ include.author.bio | markdownify }}

+
+
+
diff --git a/_includes/blog_card.html b/_includes/blog_card.html new file mode 100644 index 00000000..397cfc04 --- /dev/null +++ b/_includes/blog_card.html @@ -0,0 +1,46 @@ +{% assign size = include.size | default: 'regular' %} {% assign author = +site.data.authors[include.post.author] %} + +
  • +
    +

    + {{ include.post.title }} +

    +

    + Posted on {{ include.post.date | date: "%b %d, %Y" }} by + + {{author.name }} + +

    +
    + {% include tag_cloud.html %} + +
    +
    + + +
    + +
    + {{ include.post.excerpt | strip_html }} +
    + + Continue Reading » +
  • diff --git a/_includes/collecttags.html b/_includes/collecttags.html new file mode 100644 index 00000000..22e38c63 --- /dev/null +++ b/_includes/collecttags.html @@ -0,0 +1,18 @@ +{% assign rawtags = "" %} +{% for post in site.posts %} + {% assign ttags = post.tags | join:'|' | append:'|' %} + {% assign rawtags = rawtags | append:ttags %} +{% endfor %} +{% assign rawtags = rawtags | split:'|' | sort %} + +{% assign site.tags = "" %} +{% for tag in rawtags %} + {% if tag != "" %} + {% if tags == "" %} + {% assign tags = tag | split:'|' %} + {% endif %} + {% unless tags contains tag %} + {% assign tags = tags | join:'|' | append:'|' | append:tag | split:'|' %} + {% endunless %} + {% endif %} +{% endfor %} \ No newline at end of file diff --git a/_includes/footer.html b/_includes/footer.html index dd716c43..a2902fd2 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -34,14 +34,14 @@
    Privacy Policy Mailing List @@ -64,7 +64,7 @@ aria-label="Visit Mathesar on Github" target="_blank" > - + - + - + - + - + + + + + + +
    diff --git a/_includes/head.html b/_includes/head.html new file mode 100644 index 00000000..3ab69a04 --- /dev/null +++ b/_includes/head.html @@ -0,0 +1,32 @@ + + + + + + {% if page.description %} + + {% endif %} {% if page.image %} + + {% endif %} {% seo %} + + + {{ page.title }} + + + + + + + {% if site.tags != "" %} {% include collecttags.html %} {% endif %} + + \ No newline at end of file diff --git a/_includes/hero.html b/_includes/hero.html index ea7304f0..ae0362a3 100644 --- a/_includes/hero.html +++ b/_includes/hero.html @@ -1,5 +1,5 @@
    diff --git a/_includes/latest-blog-post.html b/_includes/latest-blog-post.html new file mode 100644 index 00000000..851472e8 --- /dev/null +++ b/_includes/latest-blog-post.html @@ -0,0 +1,22 @@ +{% assign latest_post = site.posts.first %} + diff --git a/_includes/latest-posts.html b/_includes/latest-posts.html new file mode 100644 index 00000000..e8ac07ef --- /dev/null +++ b/_includes/latest-posts.html @@ -0,0 +1,22 @@ +
    +
    +
    +

    Recent Blog Posts

    +
    + + {% assign post_count = site.posts | where_exp: "post", "post.url != page.url" | size %} + {% if post_count > 0 %} +
      + {% for post in site.posts limit:3 %} + {% if post.url != page.url %} + {% include blog_card.html post=post size='small' %} + {% endif %} + {% endfor %} +
    + {% else %} +
    +

    No recent posts available.

    +
    + {% endif %} +
    +
    diff --git a/_includes/navigation.html b/_includes/navigation.html index 139076f0..73ac32cb 100644 --- a/_includes/navigation.html +++ b/_includes/navigation.html @@ -1,8 +1,12 @@