fleet/website/config/env/development.js

24 lines
619 B
JavaScript
Raw Normal View History

/**
* Development environment settings
* (sails.config.*)
*
* The configuration in this file only applies when Sails is running
* in the local development environment.
*/
module.exports = {
// Develop locally on http://localhost:2024
// (instead of the standard default for Sails apps, http://localhost:1337.
// This helps avoid conflicts since `fleetctl preview` will very often already
// be running on port 1337 on your computer.)
port: 2024,
Compile markdown docs (#714) * Brought in the mostly-unchanged stuff from Sails website- changed just enough to get it working * inline beforeConvert and afterConvert, for readability because it's better when you tell a story with the parts of the story in order * trivial (change arg name for clarity) * trivial (apply more up-to-date err callback convention) * modernize some of the bits relying on reassigning arguments * convert the rest of the way to async/await * trivial * just aesthetics * remove reliance on app-level config * mostly i'm doing this to remember how it works * normalize better so this can be more flexible * this makes it work (albeit needs a bit more fluffing) * strip out more sails-specific stuff * clean up menu files between runs, scrape off a bit more technical debt * scrape out some more dead code * use devDependencies for markdown compilation stuff since it won't be compiling at runtime * stub script for compiling markdown content * Fill in implementation of script, rename helper. * add note about the non-markdown file problem * tweak output paths for clarity * Improve generated menu content and set up groundwork for being able to easily access it via config * Use .sailsrc to hold onto menu content, so it's injected into config for easier access (rather than reading JSON files whenever needed) * more explicit tmp filename, in case we forget how this works later * fix typo in build script (missing .js extension) * Stub query detail page and a dev route for developing it http://localhost:2024/sandbox/example-query * fix helper friendlyName * Run compilation in series to avoid race condition in doc-templater when cloning from the same repo. Add todos about sitemap and further menu data cleanup. * make sandbox actually useful * Help prevent accidental checking in of compiled HTML files. * rename script and generated folder in partials/ * fix/expand script metadata
2021-05-10 04:48:59 +00:00
// Add any dev-only routes for local development of not-yet-released pages.
// e.g. http://localhost:2024/sandbox/example-query
routes: {
Put live documentation on fleetdm.com (#1380) * minor clarifications * further expand comments and stubs * absorb custom titles embedded in metadata, plus further comment expansion and a followup fix for something i left hanging in f8cbc14829d91e7577c63307fd9c4346dbc229bb * Skip non-markdown files and use real path maths * Prep for running in parallel (Remove `continue` so this isn't dependent on the `for` loop) * determine + track unique HTML output paths * Compile markdown + spit out real HTML (without involving any but the crunchy nougaty dependency from the very center of everything) * add md metadata parsing * add timestamp * Update build-static-content.js * attach misc metadata as "other" * how doc images might should work (this also aligns with how the select few images in the sailsjs.com docs work) * add file extension to generated HTML files * "options"=>"meta" * Make "htmlId" useful for alphabetically sorting pages within their bottom-level section See recent comments on https://github.com/fleetdm/fleet/issues/706 for more information. * list out the most important, specific build-time transformations * Omit ordering prefixes like "1-" from expected content page URLs * add a little zone for consolidating backwards compatible permalinks * interpret README.md files by mapping their URLs to match their containing folder * clarify plan for images * decrease probability of collisions * Make capitalization smarter using known acronyms, proper nouns, and a smarter numeric word trim * Resolve app path in case pwd is different in prod * Delete HTML output from previous runs, if any * condense the stuff about github emojis * got rid of "permalink" thing, since id gets automatically attached during markdown compilation anyway Also "permalink" isn't even a good name for what this is. See https://github.com/fleetdm/fleet/issues/706#issuecomment-884693931 * …and that eliminates the need for the cheerio dep! * Bring in bubbles+syntax highlighting into build script, and remove sails.helpers.compileMarkdownContent() -- this leaves link munging as a todo though * trivial (condense comments) * Remove unused code from toHtml() helper * Implemented target="_blank" and root-relative-ification * remove todo about emojis after testing and verifying it works just fine * trivial: add link to comment in case github emojis matter at some point * consolidate "what ifs" in comments * Leave this up to Sarah, for now. (Either bring it back here in the build script or do it all on the frontend) * Enable /docs and /handbook routes, and add example of a redirect for a legacy/deprecated URL * implement routing * Upgrade deps this takes advantages of the latest work from @eashaw, @rachaelshaw, and the rest of the Sails community * tweak var names and comments * make readme pages use their folder names to determine their default (fallback) titles as discussed in https://github.com/fleetdm/fleet/issues/706#issuecomment-884788002 * first (good enough for now) pass at link rewriting as discussed in https://github.com/fleetdm/fleet/issues/706#issuecomment-884742072 * Adapt docs pages to build from markdown output * Continue work on docs pages * Add landing page * Remove unused code; minor changes * Replace regex * fixes https://github.com/fleetdm/fleet/pull/1380#issuecomment-891429581 * Don't rely on "path" being a global var * Syle fleetdm doc pages * Continue work on docs pages * Fix linting error * Disable lesshint style warnings * parasails-has-no-page-script attribute Added a parasails-has-no-page-script attribute to the docs template, added a check for that attribute in parasails.js and removed the empty page script for 498 * bring in latest parasails dep * trivial * Update links to dedupe and not open in new tab unless actually external * Disable handbook for now til styles are ready * fix CTA links * trivial * make sitemap.xml get served in prod * hide search boxes for now, remove hard-coded version and make releases open in new tab * clean out unused files Co-authored-by: gillespi314 <73313222+[email protected]> Co-authored-by: eashaw <[email protected]>
2021-08-18 00:55:13 +00:00
Compile markdown docs (#714) * Brought in the mostly-unchanged stuff from Sails website- changed just enough to get it working * inline beforeConvert and afterConvert, for readability because it's better when you tell a story with the parts of the story in order * trivial (change arg name for clarity) * trivial (apply more up-to-date err callback convention) * modernize some of the bits relying on reassigning arguments * convert the rest of the way to async/await * trivial * just aesthetics * remove reliance on app-level config * mostly i'm doing this to remember how it works * normalize better so this can be more flexible * this makes it work (albeit needs a bit more fluffing) * strip out more sails-specific stuff * clean up menu files between runs, scrape off a bit more technical debt * scrape out some more dead code * use devDependencies for markdown compilation stuff since it won't be compiling at runtime * stub script for compiling markdown content * Fill in implementation of script, rename helper. * add note about the non-markdown file problem * tweak output paths for clarity * Improve generated menu content and set up groundwork for being able to easily access it via config * Use .sailsrc to hold onto menu content, so it's injected into config for easier access (rather than reading JSON files whenever needed) * more explicit tmp filename, in case we forget how this works later * fix typo in build script (missing .js extension) * Stub query detail page and a dev route for developing it http://localhost:2024/sandbox/example-query * fix helper friendlyName * Run compilation in series to avoid race condition in doc-templater when cloning from the same repo. Add todos about sitemap and further menu data cleanup. * make sandbox actually useful * Help prevent accidental checking in of compiled HTML files. * rename script and generated folder in partials/ * fix/expand script metadata
2021-05-10 04:48:59 +00:00
},
};