Skip to content

Commit

Permalink
Merge branch 'astro-notion-blog'
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-locatelli committed Apr 17, 2024
2 parents 973bf11 + e603ff3 commit 73ff25f
Show file tree
Hide file tree
Showing 173 changed files with 16,140 additions and 6,171 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@


# build output
dist/

# generated types
.astro/

Expand All @@ -12,7 +15,6 @@ yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production
Expand Down
27 changes: 27 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
This repo integrates the work of Hiroki Toyokawa
Original repo: https://github.com/otoyo/astro-notion-blog
Hiroki Toyokawa blog: https://alpacat.com

---

MIT License

Copyright (c) 2023 Hiroki Toyokawa

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.
68 changes: 40 additions & 28 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,35 +1,47 @@
import { defineConfig } from "astro/config";
import mdx from "@astrojs/mdx";
import remarkGfm from "remark-gfm";
import remarkSmartypants from "remark-smartypants";
import rehypeExternalLinks from "rehype-external-links";
import { CUSTOM_DOMAIN, BASE_PATH } from "./src/server-constants";
import IndexPostImageDownloader from "./src/integrations/index-posts-cover-image-downloader";
import PostsImagesDownloader from "./src/integrations/posts-files-downloader";
import CustomIconDownloader from "./src/integrations/custom-icon-downloader";

import lottie from "astro-integration-lottie";
import sitemap from "@astrojs/sitemap";

const getSite = function () {
if (CUSTOM_DOMAIN) {
return new URL(BASE_PATH, `https://${CUSTOM_DOMAIN}`).toString();
}

if (process.env.VERCEL && process.env.VERCEL_URL) {
return new URL(BASE_PATH, `https://${process.env.VERCEL_URL}`).toString();
}

if (process.env.CF_PAGES) {
if (process.env.CF_PAGES_BRANCH !== "main") {
return new URL(BASE_PATH, process.env.CF_PAGES_URL).toString();
}

return new URL(
BASE_PATH,
`https://${new URL(process.env.CF_PAGES_URL).host
.split(".")
.slice(1)
.join(".")}`
).toString();
}

return new URL(BASE_PATH, "http://localhost:4321").toString();
};

export default defineConfig({
site: "https://buildsystems.de",
integrations: [mdx(), lottie(), sitemap()],
markdown: {
shikiConfig: {
theme: "nord",
},
remarkPlugins: [remarkGfm, remarkSmartypants],
rehypePlugins: [
[
rehypeExternalLinks,
{
target: "_blank",
},
],
],
},
image: {
remotePatterns: [
{
protocol: "https",
hostname: "**.amazonaws.com",
},
],
},
site: getSite(),
base: BASE_PATH,
integrations: [
lottie(),
sitemap(),
IndexPostImageDownloader(),
PostsImagesDownloader(),
// CustomIconDownloader(),
],
prefetch: true,
});
Loading

0 comments on commit 73ff25f

Please sign in to comment.