Skip to content

Meta refresh redirects - #88

Open
sec-ml wants to merge 218 commits into
mainfrom
meta-refresh-redirects
Open

Meta refresh redirects#88
sec-ml wants to merge 218 commits into
mainfrom
meta-refresh-redirects

Conversation

@sec-ml

@sec-ml sec-ml commented Oct 8, 2025

Copy link
Copy Markdown
Owner

Not sure if this is a good solution.

For hosting a static site somewhere like GitHub pages, you don't have access to configure the web server. If migrating content from one blog/URL pattern to another, the only option is to create a small html page at each original URL, with a meta http-equiv="refresh" directive to redirect the user.

This can be set in the astro config, but this change also allows it to be set in the frontmatter of each post, on a post by post basis.

The next commit will be the rename of [slug].astro to [...slug].astro, to support redirecting multi/level/paths to path (separate commit for diff reasons).

This meta refresh method isn't the best option if using something like vercel, or a platform with a static adaptor (see: https://docs.astro.build/en/reference/configuration-reference/#redirects), but it's possibly useful for anyone wanting to keep each post's content and config together.

Mixing and matching should also be possible.

sec-ml and others added 30 commits March 8, 2025 21:32
Replace TailwindCSS Columns 'masonry' with astro-masonry (#1)
We'll create a setting in `config.js` to set the path to the posts directory. This directory can be outside of the astro project directory (and is a relative path, based on the astro project root dir). If this is not set in `config.js`, default to `src/posts`.

Define the blog collection, include the elements already used in dummy posts, even if features (e.g. dateModified, redirects, draft) are not yet implemented.

To allow for the same boilerplate frontmatter to be generated in new markdown files, we'll allow `description`, `dateModified`, `image` and `redirects` to be blank/null.

Note: setting `optional` and `nullable` allows the field to be included as blank or not included in frontmatter at all.

If the author is not set in `config.js`, the default author (as far as content collection config is concerned) is set to a blank string.

Draft is set to true by default (i.e. if not set).

`slug` is important. This will be used to set the relative URL(i.e. after `example.com/`) following the move to a content collection. Before moving, the markdown filename (minus the extension) becomes the path. In future, this will allow files in the posts repo to be organised in directories (i.e. year, month) rather than all needing to be in a flat directory structure.
Create the dynamic route `[slug].astro` file. Creating this in the root (pages) directory means posts will be at the top level of the domain. This could be changed to `[...slug].astro` in future to allow for post pagination, supporting migrations from other blogging platforms where other structures are used (i.e. Wordpress where year/month/day/slug URLs are not uncommon).

This flie uses/calls the post layout meaning: layout doesn't need to be set in each markdown file (great!)
Move posts dir out of `src/pages` (as anything in this directory would render as part of the new content collection, but also as part of the default Astro setup. E.g.

markdown-1.md with slug md-1 would be accessible at:

example.com/posts/markdown-1
example.com/md-1

...

SEO nightmare.

Move the posts to src/dummy_posts

Another example of the filename to slug addressing is in the config file, NAV_LINKS, changing:

        { "label": "Styling Examples", "url": "/posts/styling", "suppress": false },

to:

        { "label": "Styling Examples", "url": "/styling-examples", "suppress": false },
 - Change index glob to `blog` content collection
 - change occurrences of `frontmatter` to `data`
 - set `BlogPost` URL to "/" + slug to ensure the links to posts are set to domain/post (example.com/post). This will be required when we tackle pagination.
Change `[tag].astro` glob to blog content collection
 - change occurrences of `frontmatter` to `data`
 - set `BlogPost` URL to "/" + slug to ensure the links to posts are set to domain/post (example.com/post). This will be required when we tackle pagination.
We get all tags from all posts when building the homepage, which TagSection is responsible for. Same change as [tag]/index: glob -> content collection, frontmatter -> data.
Change occurrences of frontmatter to data.
Not strictly required here, but as we added a fallback to the content collection definition, may as well add to this PR.
Bumps [astro](https://github.com/withastro/astro/tree/HEAD/packages/astro) from 5.4.1 to 5.5.2.
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/astro@5.5.2/packages/astro)

---
updated-dependencies:
- dependency-name: astro
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
+ add one example draft post
Add groupings to dependabot config
Bumps the npm-dependencies group with 2 updates: [@tailwindcss/vite](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/@tailwindcss-vite) and [tailwindcss](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/tailwindcss).


Updates `@tailwindcss/vite` from 4.0.7 to 4.0.14
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v4.0.14/packages/@tailwindcss-vite)

Updates `tailwindcss` from 4.0.7 to 4.0.14
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v4.0.14/packages/tailwindcss)

---
updated-dependencies:
- dependency-name: "@tailwindcss/vite"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: tailwindcss
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
…encies-00c88f9afa

Bump the npm-dependencies group with 2 updates
sec-ml and others added 25 commits August 25, 2025 18:59
…encies-da648bb957

Bump the npm-dependencies group with 2 updates
Bumps the npm-dependencies group with 2 updates: [astro](https://github.com/withastro/astro/tree/HEAD/packages/astro) and [daisyui](https://github.com/saadeghi/daisyui/tree/HEAD/packages/daisyui).


Updates `astro` from 5.13.3 to 5.13.5
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/astro@5.13.5/packages/astro)

Updates `daisyui` from 5.0.50 to 5.0.54
- [Release notes](https://github.com/saadeghi/daisyui/releases)
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/commits/v5.0.54/packages/daisyui)

---
updated-dependencies:
- dependency-name: astro
  dependency-version: 5.13.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: daisyui
  dependency-version: 5.0.54
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
…encies-1f0dd0bae5

Bump the npm-dependencies group with 2 updates
Bumps the npm-dependencies group with 4 updates: [@tailwindcss/vite](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/@tailwindcss-vite), [daisyui](https://github.com/saadeghi/daisyui/tree/HEAD/packages/daisyui), [tailwindcss](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/tailwindcss) and [updates](https://github.com/silverwind/updates).


Updates `@tailwindcss/vite` from 4.1.12 to 4.1.13
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v4.1.13/packages/@tailwindcss-vite)

Updates `daisyui` from 5.0.54 to 5.1.8
- [Release notes](https://github.com/saadeghi/daisyui/releases)
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/commits/v5.1.8/packages/daisyui)

Updates `tailwindcss` from 4.1.12 to 4.1.13
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v4.1.13/packages/tailwindcss)

Updates `updates` from 16.6.2 to 16.6.4
- [Release notes](https://github.com/silverwind/updates/releases)
- [Commits](silverwind/updates@16.6.2...16.6.4)

---
updated-dependencies:
- dependency-name: "@tailwindcss/vite"
  dependency-version: 4.1.13
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: daisyui
  dependency-version: 5.1.8
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-dependencies
- dependency-name: tailwindcss
  dependency-version: 4.1.13
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: updates
  dependency-version: 16.6.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps the npm-dependencies group with 6 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@astrojs/mdx](https://github.com/withastro/astro/tree/HEAD/packages/integrations/mdx) | `4.3.4` | `4.3.5` |
| [@astrojs/sitemap](https://github.com/withastro/astro/tree/HEAD/packages/integrations/sitemap) | `3.5.1` | `3.6.0` |
| [astro](https://github.com/withastro/astro/tree/HEAD/packages/astro) | `5.13.5` | `5.13.9` |
| [daisyui](https://github.com/saadeghi/daisyui/tree/HEAD/packages/daisyui) | `5.1.8` | `5.1.13` |
| [updates](https://github.com/silverwind/updates) | `16.6.4` | `16.7.2` |
| [@tailwindcss/typography](https://github.com/tailwindlabs/tailwindcss-typography) | `0.5.16` | `0.5.18` |



Updates `@astrojs/mdx` from 4.3.4 to 4.3.5
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/integrations/mdx/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/@astrojs/mdx@4.3.5/packages/integrations/mdx)

Updates `@astrojs/sitemap` from 3.5.1 to 3.6.0
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/integrations/sitemap/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/@astrojs/sitemap@3.6.0/packages/integrations/sitemap)

Updates `astro` from 5.13.5 to 5.13.9
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/astro@5.13.9/packages/astro)

Updates `daisyui` from 5.1.8 to 5.1.13
- [Release notes](https://github.com/saadeghi/daisyui/releases)
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/commits/v5.1.13/packages/daisyui)

Updates `updates` from 16.6.4 to 16.7.2
- [Release notes](https://github.com/silverwind/updates/releases)
- [Commits](silverwind/updates@16.6.4...16.7.2)

Updates `@tailwindcss/typography` from 0.5.16 to 0.5.18
- [Release notes](https://github.com/tailwindlabs/tailwindcss-typography/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss-typography/blob/main/CHANGELOG.md)
- [Commits](tailwindlabs/tailwindcss-typography@v0.5.16...v0.5.18)

---
updated-dependencies:
- dependency-name: "@astrojs/mdx"
  dependency-version: 4.3.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: "@astrojs/sitemap"
  dependency-version: 3.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-dependencies
- dependency-name: astro
  dependency-version: 5.13.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: daisyui
  dependency-version: 5.1.13
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: updates
  dependency-version: 16.7.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-dependencies
- dependency-name: "@tailwindcss/typography"
  dependency-version: 0.5.18
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps the npm-dependencies group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [@astrojs/mdx](https://github.com/withastro/astro/tree/HEAD/packages/integrations/mdx) | `4.3.5` | `4.3.6` |
| [astro](https://github.com/withastro/astro/tree/HEAD/packages/astro) | `5.13.9` | `5.14.1` |
| [daisyui](https://github.com/saadeghi/daisyui/tree/HEAD/packages/daisyui) | `5.1.13` | `5.1.25` |
| [updates](https://github.com/silverwind/updates) | `16.7.2` | `16.7.3` |
| [@tailwindcss/typography](https://github.com/tailwindlabs/tailwindcss-typography) | `0.5.18` | `0.5.19` |


Updates `@astrojs/mdx` from 4.3.5 to 4.3.6
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/integrations/mdx/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/@astrojs/mdx@4.3.6/packages/integrations/mdx)

Updates `astro` from 5.13.9 to 5.14.1
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/astro@5.14.1/packages/astro)

Updates `daisyui` from 5.1.13 to 5.1.25
- [Release notes](https://github.com/saadeghi/daisyui/releases)
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/commits/v5.1.25/packages/daisyui)

Updates `updates` from 16.7.2 to 16.7.3
- [Release notes](https://github.com/silverwind/updates/releases)
- [Commits](silverwind/updates@16.7.2...16.7.3)

Updates `@tailwindcss/typography` from 0.5.18 to 0.5.19
- [Release notes](https://github.com/tailwindlabs/tailwindcss-typography/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss-typography/blob/main/CHANGELOG.md)
- [Commits](tailwindlabs/tailwindcss-typography@v0.5.18...v0.5.19)

---
updated-dependencies:
- dependency-name: "@astrojs/mdx"
  dependency-version: 4.3.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: astro
  dependency-version: 5.14.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-dependencies
- dependency-name: daisyui
  dependency-version: 5.1.25
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: updates
  dependency-version: 16.7.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: "@tailwindcss/typography"
  dependency-version: 0.5.19
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
…encies-cb13df9598

Bump the npm-dependencies group with 5 updates
Wrap `<slot />` in a `span` to add classes. Add quote for future/custom CSS.

Pass in custom text size if `big` passed in.
Update usage example
Light/dark mode wasn't working properly. Calculate based on theme config mode.
use `has-bg` to determine if the diagram has the surrounding background. If so, reduce image top/bottom margin to 0 (from 2em). Add 1em top/bottom margin to the bg container (2 would be too much on top of the padding).
Custom diagram component. Fixes #83
Bumps the npm-dependencies group with 4 updates: [@tailwindcss/vite](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/@tailwindcss-vite), [daisyui](https://github.com/saadeghi/daisyui/tree/HEAD/packages/daisyui), [tailwindcss](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/tailwindcss) and [updates](https://github.com/silverwind/updates).


Updates `@tailwindcss/vite` from 4.1.13 to 4.1.14
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v4.1.14/packages/@tailwindcss-vite)

Updates `daisyui` from 5.1.25 to 5.1.27
- [Release notes](https://github.com/saadeghi/daisyui/releases)
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/commits/v5.1.27/packages/daisyui)

Updates `tailwindcss` from 4.1.13 to 4.1.14
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v4.1.14/packages/tailwindcss)

Updates `updates` from 16.7.3 to 16.8.0
- [Release notes](https://github.com/silverwind/updates/releases)
- [Commits](silverwind/updates@16.7.3...16.8.0)

---
updated-dependencies:
- dependency-name: "@tailwindcss/vite"
  dependency-version: 4.1.14
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: daisyui
  dependency-version: 5.1.27
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: tailwindcss
  dependency-version: 4.1.14
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: updates
  dependency-version: 16.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
…encies-85035cff47

Bump the npm-dependencies group with 4 updates
Add <Collapse ... ></Collapse> section and example usage.
Add keyboard keys. Useful for showing keyboard shortcuts. Add lookup for common symbols. Split multiple space/comma/plus separated keys within the same <KBD> call to multiple keys.
Add keyboard key custom MDX component
Not sure if this is a good solution.

For hosting a static site somewhere like GitHub pages, you don't have access to configure the web server. If migrating content from one blog/URL pattern to another, the only option is to create a small html page at each original URL, with a `meta http-equiv="refresh"` directive to redirect the user.

This can be set in the astro config, but this change also allows it to be set in the frontmatter of each post, on a post by post basis.

The next commit will be the rename of [slug].astro to [...slug].astro, to support redirecting multi/level/paths to path (separate commit for diff reasons).

This meta refresh method isn't the best option if using something like vercel, or a platform with a static adaptor (see: https://docs.astro.build/en/reference/configuration-reference/#redirects), but it's possibly useful for anyone wanting to keep each post's content and config together.

Mixing and matching should also be possible.
@vercel

vercel Bot commented Oct 8, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
nought Ready Ready Preview Comment Oct 8, 2025 8:01pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant