diff --git a/.eleventy.js b/.eleventy.js deleted file mode 100644 index 6aa31755..00000000 --- a/.eleventy.js +++ /dev/null @@ -1,211 +0,0 @@ -const pluginRss = require("@11ty/eleventy-plugin-rss"); -const slugify = require("slugify"); -const embedEverything = require("eleventy-plugin-embed-everything"); -const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight"); -const eleventyNavigationPlugin = require("@11ty/eleventy-navigation"); -const path = require('path'); -const sitemap = require("@quasibit/eleventy-plugin-sitemap"); - -module.exports = function (eleventyConfig) { - if(!process.env.ELEVENTY_PRODUCTION) { - eleventyConfig.setQuietMode(true); - } - - eleventyConfig.setBrowserSyncConfig({ - ui: false, - ghostMode: false - }); - - eleventyConfig.addPlugin(pluginRss); - eleventyConfig.addPlugin(embedEverything); - eleventyConfig.addPlugin(syntaxHighlight); - eleventyConfig.addPlugin(eleventyNavigationPlugin); - eleventyConfig.addPlugin(sitemap, { - sitemap: { - hostname: "https://exceptionless.com", - }, - }); - - eleventyConfig.addPassthroughCopy("content/assets"); - eleventyConfig.addPassthroughCopy("content/favicon.ico"); - eleventyConfig.addPassthroughCopy("content/**/*.jpg"); - eleventyConfig.addPassthroughCopy("content/**/*.png"); - eleventyConfig.addPassthroughCopy("content/**/*.gif"); - eleventyConfig.addPassthroughCopy("content/_redirects"); - - eleventyConfig.setDataDeepMerge(true); - - // ------------------------------------------------------------------------ - // Markdown plugins - // ------------------------------------------------------------------------ - - const markdownIt = require('markdown-it'); - - const markdownItOptions = { - html: true, - breaks: true, - linkify: false, - replaceLink: function (link, env) { - const doNothing = ['http://', 'https://', '/', '#', 'mailto:']; - if (doNothing.some((protocol) => link.startsWith(protocol))) - return link; - - let dir = path.dirname(env.page?.filePathStem ?? ''); - let fullPath = dir + '/' + link; - - fullPath = fullPath.replace(/index.md$/, '').replace(/.md$/, '/'); - - return fullPath; - } - }; - - const markdownItFootnote = require('markdown-it-footnote'); - - const markdownItAnchor = require('markdown-it-anchor'); - - const markdownItAnchorOptions = { - permalink: true, - permalinkClass: 'deeplink', - permalinkSymbol: '#', - level: [2, 3, 4], - slugify: function (s) { - return slugify(s, { - replacement: "-", - remove: /[*+~()'"!:@]/g, - lower: true, - strict: true, - }); - }, - }; - - const markdownItAttributes = require('markdown-it-attrs'); - - const markdownItSpan = require('markdown-it-bracketed-spans'); - - const markdownItAlerts = require('markdown-it-alerts'); - - const markdownItAbbr = require('markdown-it-abbr'); - - const markdownItReplaceLink = require('markdown-it-replace-link'); - - function getHeadingLevel(tagName) { - if (tagName[0].toLowerCase() === 'h') { - tagName = tagName.slice(1); - } - - return parseInt(tagName, 10); - } - - function markdownItHeadingLevel(md, options) { - var firstLevel = options.firstLevel; - - if (typeof firstLevel === 'string') { - firstLevel = getHeadingLevel(firstLevel); - } - - if (!firstLevel || isNaN(firstLevel)) { - return; - } - - var levelOffset = firstLevel - 1; - if (levelOffset < 1 || levelOffset > 6) { - return; - } - - md.core.ruler.push('adjust-heading-levels', function (state) { - var tokens = state.tokens; - for (var i = 0; i < tokens.length; i++) { - if (tokens[i].type !== 'heading_close') { - continue; - } - - var headingOpen = tokens[i - 2]; - var headingClose = tokens[i]; - - var currentLevel = getHeadingLevel(headingOpen.tag); - var tagName = 'h' + Math.min(currentLevel + levelOffset, 6); - - headingOpen.tag = tagName; - headingClose.tag = tagName; - } - }); - } - - const md = markdownIt(markdownItOptions) - .disable('code') - .use(markdownItHeadingLevel, { firstLevel: 2 }) - .use(markdownItFootnote) - .use(markdownItAnchor, markdownItAnchorOptions) - .use(markdownItAttributes) - .use(markdownItSpan) - .use(markdownItAbbr) - .use(markdownItReplaceLink) - .use(markdownItAlerts); - - md.renderer.rules.table_open = function(tokens, idx) { - return ''; - }; - - const m2j = require('./m2json'); - const glob = require('glob'); - const options = { - minify: false, - width: 70, - outfile: './content/assets/index.json', - content: true - }; - // Read all markdown files - glob('./content/docs/**/*.md', function(er, files) { - m2j.parse(files, options); - }); - - - eleventyConfig.setLibrary('md', md); - - eleventyConfig.addFilter('markdownify', (markdownString) => - md.render(markdownString) - ); - - eleventyConfig.addFilter("slug", function (value) { - return slugify(value, { - replacement: "-", - remove: /[*+~()'"!:@]/g, - lower: true, - strict: true, - }); - }); - - eleventyConfig.addNunjucksFilter("json", function (value) { - if (!value) return ""; - - const getCircularReplacer = () => { - const seen = new WeakSet(); - return (key, value) => { - if (typeof value === "object" && value !== null) { - if (seen.has(value)) { - return; - } - seen.add(value); - } - return value; - }; - }; - - return JSON.stringify(value, getCircularReplacer(), 4); - }); - - return { - templateFormats: ["html", "md", "njk", "json"], - - markdownTemplateEngine: "njk", - htmlTemplateEngine: "njk", - dataTemplateEngine: "njk", - dir: { - output: "_site", - data: "_data", - input: "content", - includes: "_includes", - layouts: "_layouts", - }, - }; -}; diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..2a0e4e3a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,31 @@ +name: Publish + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup Deno environment + uses: denoland/setup-deno@v1 + with: + deno-version: v1.x + + - name: Install lume + run: | + deno run -A https://deno.land/x/lume/install.ts + lume upgrade --dev + + - name: Run lume + run: | + lume --location=https://exceptionless.github.io/website/ + + - name: Deploy + uses: crazy-max/ghaction-github-pages@v2 + with: + build_dir: _site + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index fddfe8d4..34272c74 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -node_modules/ -_site/ -.idea -content/assets/index.json +.DS_Store +_site +node_modules/ \ No newline at end of file diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 19c7bdba..00000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -16 \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index e7301e11..b163edac 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,13 +1,44 @@ { + "version": "0.2.0", "configurations": [ { - "type": "node", "request": "launch", - "name": "Launch 11ty", - "program": "${workspaceFolder}\\node_modules\\@11ty\\eleventy\\cmd.js", + "name": "Lume build", + "type": "pwa-node", + "program": "${workspaceFolder}/_config.ts", + "cwd": "${workspaceFolder}", + "runtimeExecutable": "deno", + "runtimeArgs": [ + "run", + "--unstable", + "--import-map=.vscode/lume_import_map.json", + "--inspect", + "--allow-all" + ], + "attachSimplePort": 9229 + }, + { + "request": "launch", + "name": "Lume serve", + "type": "pwa-node", + "program": "file://d:/Projects/Other/lume/cli.ts", + "cwd": "${workspaceFolder}", + "runtimeExecutable": "deno", + "runtimeArgs": [ + "run", + "--unstable", + "--import-map=.vscode/lume_import_map.json", + "--inspect", + "--allow-all", + "--reload" + ], "args": [ - // "--output=C:\\Temp" - ] + "--serve" + ], + "attachSimplePort": 9229 } ] -} \ No newline at end of file +} + + + diff --git a/.vscode/lume_import_map.json b/.vscode/lume_import_map.json new file mode 100644 index 00000000..3251553d --- /dev/null +++ b/.vscode/lume_import_map.json @@ -0,0 +1,5 @@ +{ + "imports": { + "https://deno.land/x/lume/": "https://deno.land/x/lume@v1.4.1/" + } +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 8e3bb757..95bd6bb5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,36 +1,11 @@ { - "cSpell.words": [ - "Aliyun", - "Burcham", - "Foundatio", - "Geocode", - "Gmail", - "Kibana", - "Kubernetes", - "Lucene", - "Minio", - "OWIN", - "Reindex", - "Reindexing", - "Serilog", - "Trello", - "Varorbc", - "Zurb", - "Zurb's", - "adamsitnik", - "angularjs", - "caesay", - "deduplicated", - "deduplicating", - "edwardmeng", - "eleventy", - "exceptionless", - "frankebersoll", - "kubectl", - "pluggable", - "serializers", - "srijken", - "typeof", - "walkthrough" - ] + "deno.enable": true, + "deno.lint": true, + "deno.unstable": true, + "deno.importMap": ".vscode/lume_import_map.json", + "deno.suggest.imports.hosts": { + "https://cdn.skypack.dev": true, + "https://cdn.jsdelivr.net": true, + "https://deno.land": true + } } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 4b3a56c3..fc8aabe4 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,30 +1,31 @@ { "version": "2.0.0", "tasks": [ - { - "type": "npm", - "script": "dev", - "problemMatcher": [], - "label": "npm: dev", - "detail": "npx @11ty/eleventy --serve" - }, - { - "type": "npm", - "script": "build", - "group": { + { + "label": "Lume build", + "type": "shell", + "command": "lume", + "group": { "isDefault": true, "kind": "build" }, - "problemMatcher": [], - "label": "npm: build", - "detail": "npx @11ty/eleventy" - }, - { - "type": "npm", - "script": "install", - "problemMatcher": [], - "label": "npm: install", - "detail": "install dependencies from package" - } - ] + "presentation": { + "reveal": "always", + "panel": "dedicated" + } + }, + { + "label": "Lume serve", + "type": "shell", + "command": "lume", + "args": [ + "--serve" + ], + "group": "build", + "presentation": { + "reveal": "always", + "panel": "dedicated" + } + } + ] } \ No newline at end of file diff --git a/README.md b/README.md index 124bd8dd..293f255c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ ## Exceptionless Marketing Site -*Under Construction* - ## Creating New Posts You can manually create a new markdown file for your posts and ensure the front matter is correct, or you can run the following command from within the project directory: diff --git a/_config.ts b/_config.ts new file mode 100644 index 00000000..f2827a89 --- /dev/null +++ b/_config.ts @@ -0,0 +1,37 @@ +import lume from "https://deno.land/x/lume/mod.ts"; +import date from "https://deno.land/x/lume/plugins/date.ts"; +import postcss from "https://deno.land/x/lume/plugins/postcss.ts"; +import terser from "https://deno.land/x/lume/plugins/terser.ts"; +import codeHighlight from "https://deno.land/x/lume/plugins/code_highlight.ts"; +import basePath from "https://deno.land/x/lume/plugins/base_path.ts"; +import slugifyUrls from "https://deno.land/x/lume/plugins/slugify_urls.ts"; +import resolveUrls from "https://deno.land/x/lume/plugins/resolve_urls.ts"; +import gpm from "https://deno.land/x/gpm@v0.2.0/mod.ts"; + +const site = lume({ + location: new URL("https://exceptionless.com/"), + prettyUrls: true, + src: "content", + server: { + open: true + } +}); + +site + .ignore("README.md") + .copy("assets") + .use(postcss()) + .use(terser()) + .use(date()) + .use(codeHighlight()) + .use(basePath()) + .use(slugifyUrls({ alphanumeric: false })) + .use(resolveUrls()) + .addEventListener( + "beforeBuild", + () => gpm(["oom-components/searcher"], "content/assets/js"), + ); + +export default site; + +if (import.meta.main) site.build(); \ No newline at end of file diff --git a/content/404.md b/content/404.md index 090b06bc..9decf8da 100644 --- a/content/404.md +++ b/content/404.md @@ -1,8 +1,7 @@ --- title: Not Found -layout: content-well -permalink: 404.html -eleventyExcludeFromCollections: true +layout: layouts/content-well.njk +url: /404.html --- Sorry, but the page you were trying to view does not exist. diff --git a/content/_data/eleventyComputed.js b/content/_data/eleventyComputed.js deleted file mode 100644 index 31092ef1..00000000 --- a/content/_data/eleventyComputed.js +++ /dev/null @@ -1,44 +0,0 @@ -module.exports = { - eleventyNavigation: { - key: (data) => { - const urlParts = data.page.url.split("/"); - - const pathDirs = urlParts.slice(1, urlParts.length - 1); - const path = pathDirs.join("/"); - return data.key || path; - }, - title: (data) => data.title, - parent: (data) => { - const urlParts = data.page.url.split("/"); - - const parentDirs = urlParts.slice(1, urlParts.length - 2); - const parent = parentDirs.join("/"); - - return data.parent || parent; - }, - order: (data) => data.order, - }, - eleventyComputed: { - /** - * Adds support for drafts. - * If a page has `draft: true` in its YAML frontmatter then this snippet - * will set its permalink to false and exclude it from collections. - * - * For dev builds we will always render the page. - */ - permalink: data => { - if (data.draft) { - return false; - } - - return data.permalink; - }, - eleventyExcludeFromCollections: data => { - if (data.draft) { - return true; - } - - return false; - } - } -}; \ No newline at end of file diff --git a/content/_data/site.json b/content/_data/site.json deleted file mode 100644 index d4fa5b53..00000000 --- a/content/_data/site.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "title": "Exceptionless", - "description": "Real-time exception reporting for ASP.NET, Web API, WebForms, WPF, Console, and MVC applications. Includes event organization, notifications, and more.", - "url": "https://exceptionless.com", - "author": "Exceptionless Team", - "twitter": "Exceptionless", - "analyticsId": "UA-433340-8", - "intercomId": "6c0d76e0bec950052459f5cb4b727a949aeabbe1" -} \ No newline at end of file diff --git a/content/_data/site.yml b/content/_data/site.yml new file mode 100644 index 00000000..5288605f --- /dev/null +++ b/content/_data/site.yml @@ -0,0 +1,8 @@ +title: Exceptionless +description: Real-time exception reporting for ASP.NET, Web API, WebForms, WPF, Console, and MVC applications. Includes event organization, notifications, and more. +author: + name: Exceptionless Team + email: team@exceptionless.com +twitter: Exceptionless +analyticsId: UA-433340-8 +intercomId: 6c0d76e0bec950052459f5cb4b727a949aeabbe1 diff --git a/content/_includes/docs-toc.html b/content/_includes/docs-toc.html deleted file mode 100644 index 4e746a77..00000000 --- a/content/_includes/docs-toc.html +++ /dev/null @@ -1,4 +0,0 @@ -{%- if eleventyNavigation -%} - {%- set navKey = eleventyNavigation.key -%} -{%- endif -%} -{{ collections.docs | eleventyNavigation | eleventyNavigationToHtml({ activeKey: navKey, listClass: 'toc-list', activeListItemClass: 'toc-active' }) | safe }} diff --git a/content/_includes/layouts/archive.njk b/content/_includes/layouts/archive.njk new file mode 100644 index 00000000..e6c44907 --- /dev/null +++ b/content/_includes/layouts/archive.njk @@ -0,0 +1,30 @@ +--- +layout: layouts/content.njk +bodyClass: body-tag +--- +

{{ title }}

+ +{% set postslist = results %} +{% include "templates/postslist.njk" %} + +
+ + \ No newline at end of file diff --git a/content/_layouts/content-well.njk b/content/_includes/layouts/content-well.njk similarity index 91% rename from content/_layouts/content-well.njk rename to content/_includes/layouts/content-well.njk index a16dd9b2..c8cbd291 100644 --- a/content/_layouts/content-well.njk +++ b/content/_includes/layouts/content-well.njk @@ -1,5 +1,5 @@ --- -layout: default +layout: layouts/default.njk ---