Skip to content

Commit

Permalink
Initial upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ogoregen committed Oct 25, 2024
1 parent 3989771 commit c3b9da2
Show file tree
Hide file tree
Showing 22 changed files with 21,512 additions and 1 deletion.
97 changes: 97 additions & 0 deletions .github/workflows/gatsby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Sample workflow for building and deploying a Gatsby site to GitHub Pages
#
# To get started with Gatsby see: https://www.gatsbyjs.com/docs/quick-start/
#
name: Deploy Gatsby site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

# Default to bash
defaults:
run:
shell: bash

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine package manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
with:
# Automatically inject pathPrefix in your Gatsby configuration file.
#
# You may remove this line if you want to manage the configuration yourself.
static_site_generator: gatsby
- name: Restore cache
uses: actions/cache@v4
with:
path: |
public
.cache
key: ${{ runner.os }}-gatsby-build-${{ hashFiles('public') }}
restore-keys: |
${{ runner.os }}-gatsby-build-
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Build with Gatsby
env:
PREFIX_PATHS: 'true'
run: ${{ steps.detect-package-manager.outputs.manager }} run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./public

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
.cache/
public
.gitmodules
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 ogoregen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@

# md-blog
nothing less nor more than a blog

Reads Markdown files into blog posts and pages. Features RSS, code syntax highlighting.

You can use this template repository as a starter for your [Gatsby](https://www.gatsbyjs.com/) blog or use it as is. All site-specific content is placed under `data/`.
9 changes: 9 additions & 0 deletions data/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

const CONFIG = {
title: "md-blog",
description: "nothing less nor more than a blog",
url: "https://ogoregen.github.io/md-blog/",
copyright: "CC-BY-SA",
};

module.exports = CONFIG;
Binary file added data/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions data/pages/another-page/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: "another page"
slug: "another-page"
description: "Another page"
index: 2
---

This is another page.
8 changes: 8 additions & 0 deletions data/pages/page/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: "a page"
slug: "a-page"
description: "A page"
index: 1
---

This is a page.
8 changes: 8 additions & 0 deletions data/posts/hello-world/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: "Hello world"
date: "2024-10-25"
slug: "hello-world"
description: "A post on md-blog"
---

This is a post.
66 changes: 66 additions & 0 deletions data/posts/pro-quin-prodes-in-delos/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: "Pro quin prodes in Delos"
date: "2024-10-25"
slug: "pro-quin-prodes-in-delos"
description: "Pallade alii vestrum marmore Iovis, Troiani."
---

## Ante quorum

Lorem markdownum *clipei virginis* Pallade alii vestrum marmore Iovis, Troiani.
Ipse sublimis nam quid eratque ara summa terra trifida tum istis sedem,
Haemonio. Si mare, **exemplumque nihil** vestem [diversa
aera](http://abtabellis.com/ulterius) succeditis **corpora**. Est palluit tota;
aquosis quos hippomene refert resque, segetes conripimus intravit luctu!

Horrenda maxima et et procerum mixtis se concita atque Aeetias. Perpetuo faterer
electae ab moenia multos. Loca insignia Theseu ungues, duae et insons reddit si
unda nostras, cum artes. Trepidum diffudit.

## Intexuit firmo

Terrebat vota vitae gemelliparae forte velocius nova platanus teneras lingua
inplicuit intravit rapidas. Meo cineres inplet sua ante concava illi, tauros
oculos. Vetus cetera, venit, vix terrae ambitae et *potius iussis* imagine
fortis pretium coniunx ad Latiaeque tanta; **omne**!

```c
static void memswap(char *px, char *py, size_t size)
{
char buf[256];
size_t blocksz;

while (0 < size)
{
blocksz = size < sizeof(buf) ? size : sizeof(buf);
memcpy(buf, px, blocksz);
memcpy(px, py, blocksz);
memcpy(py, buf, blocksz);

px += blocksz;
py += blocksz;
size -= blocksz;
}
}
```
## Quaerunt cessant
Inter luna inopino medio virginitas impediunt luctus et lateri est cava causa
alimentaque quae. Nec fide, votis accipiunt verbaque, Argum incubuit, numen
effetus: ignarus ecce.
## Nunc habeant est neque oppugnant
Dicet hic scrobibus viris, huius. Nova sole, armo blanditias; alebat male, vasti
editus. Ara ille sacerdos aerias? Litore vidit cupidi: meum flexi!
1. Regis tibi colla inferior pomaque aemula nullo
2. Iuxta dixit
3. Pete saucius morte inque ibitis donec votis
4. Volucrumque videt et dolebat
5. Efficiet pariterque trahit veniunt solum plaga
Sibi macies artus maius amicas exspectanda bracchia utrumque poena precor cede
nec summum amplectitur caesis. Mea signo perdidit **versabat** utque; matrem
quater si flammas Achillem.
2 changes: 2 additions & 0 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

require("prismjs/themes/prism.css");
109 changes: 109 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@

const CONFIG = require("./data/config.js");

/**
* @type {import('gatsby').GatsbyConfig}
*/
module.exports = {
pathPrefix: "/md-blog",
siteMetadata: {
title: CONFIG.title,
description: CONFIG.description,
siteUrl: CONFIG.url,
},
plugins: [
"gatsby-plugin-image",
"gatsby-plugin-sharp",
"gatsby-transformer-sharp",
{
resolve: "gatsby-plugin-feed",
options: {
feeds: [
{
serialize: ({query: {site, allMarkdownRemark}}) => {

return allMarkdownRemark.nodes.map(node => {

return Object.assign({}, node.frontmatter, {

description: node.excerpt,
date: node.frontmatter.date,
url: site.siteMetadata.siteUrl + node.frontmatter.slug,
guid: site.siteMetadata.siteUrl + node.frontmatter.slug,
custom_elements: [{"content:encoded": node.html}],
});
});
},
query: `
{
allMarkdownRemark(
filter: { fileAbsolutePath: { regex: "/(posts)/" } },
sort: { frontmatter: { date: DESC } })
{
nodes{
html
excerpt
frontmatter{
slug
title
date(formatString: "MMMM D, YYYY")
}
}
}
}
`,
output: "/rss.xml",
title: CONFIG.title,
},
],
},
},
{
resolve: "gatsby-source-filesystem",
options: {
name: "pages",
path: `${__dirname}/data/pages/`,
},
},
{
resolve: "gatsby-source-filesystem",
options: {
name: "posts",
path: `${__dirname}/data/posts/`,
},
},
{
resolve: "gatsby-plugin-preconnect",
options: {
domains: [
{domain: "https://rsms.me/", crossOrigin: false},
],
},
},
{
resolve: `gatsby-plugin-manifest`,
options: {
icon: "data/favicon.png",
},
},
{
resolve: "gatsby-transformer-remark",
options: {
plugins: [
{
resolve: "gatsby-remark-images",
options: {
maxWidth: 1200,
},
},
{
resolve: "gatsby-remark-prismjs",
options: {
classPrefix: "language-",
},
},
],
},
},
]
};
Loading

0 comments on commit c3b9da2

Please sign in to comment.