Commit graph

77 commits

Author SHA1 Message Date
Yangshun Tay
9d4a5d5359
Prettify all JavaScript files (#964)
* Prettify all JavaScript files

* Make trailingComma all

* Delete v2/.prettierignore

* Remove v2 Prettier commands in package.json
2018-09-17 15:34:55 +08:00
Endilie Yacop Sucipto
4a2b7cf614 fix: nested static in static breaks build (#953) 2018-09-12 07:31:10 +08:00
Endilie Yacop Sucipto
5fae14a2bf
fix: copy static image as it is if image compression fail (#887)
* fix: fail to copy static image due to image compression on build

* add changelog
2018-08-04 22:40:36 +08:00
Endilie Yacop Sucipto
afec4bd47c
Refactor(server): share logic between server.js & generate.js (#856)
* nits too many comments

* Refactor to blog.getPages

* Refactor to getPost, fileToUrl, urlToFile

* Refactor redirectcomponent generation for docs

* nits & fix typo

* Refactor to blog.getMetadata

* Add test for getMetadata, fileToSUrl and urlToSource

* use includes() and add 'markup' naming for function
2018-07-24 13:37:52 +07:00
Sashank Thupukari
d3417b3bf2 Add autoprefixing to CSS pipeline (#867)
Add [autoprefixer](https://github.com/postcss/autoprefixer) as a final build step in the CSS pipeline.
2018-07-22 00:05:13 -07:00
Endilie Yacop Sucipto
9f718a5097 Refactor + add more tests (Part 2) (#854)
* Refactor doc in server.js & generate.js

* Refactor finding metadata with find() & avoid param reassign

* Refactor replacing markdown link to html + add test

* Minify func to getFile & add test

* use ./ for md link as well

* nits & better test

* better mdToHtmlify

* babel-register on versions & write-translations to transpile ES6 in server/env.js

* better docs test & move out metadata to fixtures

* Update .babelrc
2018-07-16 01:45:23 -07:00
Endilie Yacop Sucipto
defcbcc8ee Refactor + add more tests (Part 1) (#847)
* Refactor mdToHtml out

* Refactor routing + move it to server instead of core

* Refactor & Add more tests for server utils

* Refactor isSeparateCss function from server & generate

* Refactor insertTableOfContents from server & generate + add tests

* undo small nits
2018-07-13 11:31:37 -07:00
Yangshun Tay
a7a214fb3a ESLintify Part 3 (#846)
* ESLintify Part 3

* ESLintify Part 3

* ESLintify Part 3
2018-07-11 18:21:31 +08:00
Yangshun Tay
5ac2cee658
ESLintify Part 2 (#841)
* ESLintify Part 2

* Fix

* Fix tests

* Fix tests

* Fix tests
2018-07-10 21:53:08 -07:00
Yangshun Tay
4267337fb0
Fix CSS tests (#839)
* Fix CSS tests

* Revamp

* -

* fix failing test

* add test for minifyCss with fixtures & snapshot

* remove unintended addition

* simplify the test.css
2018-07-10 10:42:32 -07:00
Yangshun Tay
e8e3f42685
ESLintify Part 1 (#837)
* ESLint-ify

* Allow empty try/catch

* Escape regexp
2018-07-08 09:13:18 -07:00
Endilie Yacop Sucipto
3566483aa5 Fix wrong sitemap for alternate URL (#828) 2018-07-04 11:13:30 -07:00
Endilie Yacop Sucipto
21dcea2a31
Integrate eslint & precommit to codebase (#815)
* add eslint, precommit & refactor

* fix exit code 127

* modify contributing.md & add package-lock

* use .eslintrc.js
2018-07-01 12:27:31 +08:00
Yangshun Tay
1094dbd352
CSS revamp - Improve typography and overall styling (#757)
* Improve CSS code

* Fix blog layout

* Fix

* Refactor onPageNav

* More fixes

* Fix docs nav

* Use alternative hack

* Tweak clearfix
2018-06-19 21:46:15 -07:00
Rémi Doreau
a77ae958db Duplicate code in readMetadata.js & versionFallback.js #725 (#726)
* Duplicate code in readMetadata.js & versionFallback.js #725

* Putting back package-lock.json

* Rename lib/server/utilsMetadata.js -> lib/server/metadataUtils.js

* Update splitHeader + extractMetadata

* Update prettier
2018-06-12 12:25:23 +08:00
Endilie Yacop Sucipto
c47af6be4b Enable custom meta description for custom pages (#752) 2018-06-10 09:35:30 -07:00
Endilie Yacop Sucipto
31f0c27f81 Enable clean / extension-less url (#677) 2018-06-06 13:37:49 -07:00
Endilie Yacop Sucipto
72f4f36939 Enable setting of title for custom pages
* allowing custom title on page component

* Update about-slash.js

* Update help.js

* Update users.js

* Update versions.js
2018-05-30 21:37:38 -07:00
Endilie Yacop Sucipto
24da6bfba0 Fix typo from #490 (#676)
`'en'` is written as `en`
2018-05-19 07:45:05 -07:00
Ahmad Alfy
ab6bab9f8d [Feature] Introducing image compression using imagemin (#654)
* Introduce imagemin for compressing images

* Replace original images with the optimized ones

* Add imagemin-svgo to dependencies

* Remove console statement, replace let with const

* Replace let with const

* Add --skip-image-compression

* Run Prettier
2018-05-09 16:59:36 -07:00
Erin Teo
5771549e75 Rename latestVersion to defaultVersion (#639)
* Rename lastVersion to defaultVersion

* Added defaultVersionShown to site-config doc

* Remove defaultVersionShown from siteConfig

* Update api-site-config.md
2018-05-05 17:24:39 -07:00
Sviatoslav
9c98142fea Ensure anchor links are unique per document (#574) 2018-05-03 19:36:12 -07:00
Paulus Schoutsen
6c9c7e5de5 Generate sitemap if any blog post or page exists (#610) 2018-04-27 23:09:47 -07:00
Yangshun Tay
159b80df94
Use cssnano to minify main CSS file (#569)
* Add cssnano to CSS generation

* Add babel-polyfill

* Call cssnano at the end

* Fix tests

* Add babelrc
2018-04-16 21:31:01 -07:00
Yangshun Tay
946e2cef90
Add <doctype HTML> to HTML pages (#566)
* Add doctype to static rendering

* Set content-type for CSS
2018-04-15 15:50:43 -07:00
Joel Marcey
cbdab2ba11
Use Path module functions and properties in server and generate (#490) 2018-03-12 16:01:40 -07:00
Elian Ibaj
48ee457ec9 Add active link classes to site navigation menu (#463) 2018-03-04 08:53:31 -08:00
jonathan-cowling
a241a46669 Make font-family as configurable parameter(#220) (#294)
We look for fonts object within siteConfig.js
2018-01-21 19:54:52 -08:00
Dániel Tar
654916ae98 Fix build on Windows (#381)
Use `path.dirName` instead of a `file.replace` on regex'd replaced string
2018-01-08 15:44:50 -08:00
Joel Marcey
665b2da09f Prettier fix for ce338fff64 2017-12-20 10:07:57 -08:00
Ricky Vetter
ce338fff64
Merge pull request #275 from rickyvetter/wrapPagesHTML
add wrapPagesHTML which renders html snippets in pages inside of a header + footer
2017-12-20 10:05:21 -08:00
Richard Zhang
a5e963dba1 Issue 305 broken link because of language fixes (#322)
* without having having to worry about site design.

Let me know if double having is intentional

* distinguish case of no translation and en lang

* prettier recommends

* distinguish case of no translation and en lang

* prettier recommends

* merge with latest origin/master changes

* typo

* link with language fixes

* do not show language dropdown if only one enabled

* check translation outside of LanguageDropDown.render
2017-12-19 17:44:43 -08:00
Joel Marcey
18c9a2ab31 Revert "Fixing Issue 305 - broken links because of language (#316)"
This reverts commit 7dc6c6c2da.
2017-12-19 09:23:41 -08:00
Richard Zhang
7dc6c6c2da Fixing Issue 305 - broken links because of language (#316)
* without having having to worry about site design.

Let me know if double having is intentional

* distinguish case of no translation and en lang

* prettier recommends

* distinguish case of no translation and en lang

* prettier recommends

* merge with latest origin/master changes

* typo
2017-12-19 09:20:32 -08:00
Hector Ramos
a7d81c629d Resolve conflicts 2017-12-12 12:49:02 -08:00
Ricky Vetter
c22203523f use faded primaryColor background for inline code snippets instead of link color (#276) 2017-12-12 12:46:52 -08:00
Ricky Vetter
786fdbb136 add wrapPagesHTML which renders html snippets in pages inside of a header + footer 2017-12-11 21:46:07 -08:00
Joel Marcey
c9e4f4479d Prettier fix 2017-12-11 16:41:09 -08:00
Héctor Ramos
11029cf02d Update build script (#272)
* Copy dot files if present in the static folder, and add .circleci config to Docusaurus site

* Update docs
2017-12-11 16:32:05 -08:00
Héctor Ramos
ad87bab09b Fix path to docs assets dir (#265) 2017-12-07 10:14:32 -08:00
Héctor Ramos
65421db62e Add Prettier Formatting (#258)
* Add Prettier formatting to source files and example files, and check that Prettier formatting is maintained on PRs

* Remove trailing-comma as we are using Node 6 on Circle

* Use latest Node 6 LTS version in Circle

* Remove unused test
2017-12-04 19:21:02 -08:00
Cheng Lou
76e423fba3 Use path module instead of string concat / (#255)
This also in part prepares for #253. I discovered a bug when setting `projectName` to `""`, and some `"build/" + projectName + "/foo"` concatenated into `"build//foo"`. Granted, it's a hack, but we should use `path` anyway.

Test: tested on https://github.com/BuckleScript/bucklescript.github.io. Seems working
2017-12-04 09:32:02 -08:00
Eric Nakagawa
8d14f8fb02
Merge pull request #217 from JoelMarcey/custom-docs-subdir
Allow custom path for the location of documentation
2017-11-13 13:50:39 -08:00
Christine Abernathy
1d3f71a60a Fix HTML copy file generation (#223) 2017-11-10 15:46:22 -08:00
Joel Marcey
dc0c1390c4 [WIP] Allow custom subpath for docs within the "docs" folder
e.g.,

The default is

`docs/*.md`

This allows

`docs/somedir/*.md`

or

`docs/somedir/anotherdir/*.md`

Notes:

- All URLs are still /docs/*.html (i.e. the subpath does not get preserved in the link).
- Files in `translated_docs`, if any, will still only be one level
- This should not affect translations or versioning
2017-11-08 20:16:05 -08:00
Eric Nakagawa
fa1ec70432 Bug fixes in generatejs (#169)
* Misc cleanups related to console.log messages in yarn build

* Fixes https://github.com/facebookexperimental/Docusaurus/issues/96
2017-10-26 16:13:56 -07:00
Eric Nakagawa
55b0f33f2a Allows periods in blog file names -- will allow for version numbers, etc (#163)
* Allows periods in blog file names -- will allow for version numbers, etc

* Removed debug lines...
2017-10-24 19:27:37 -07:00
Héctor Ramos
b832176dc6 [markdown] Switch to Remarkable (#153)
* Switch to Remarkable
* Clean up references to custom code blocks
* Remove valdiateDOMNesting warning
* Add syntax highlighting
* Add Reason support
* Breaking change: prismColor to codeColor, remove CompLibrary.Prism, expose hljs
* Completely remove Prism and associated CSS rules
* Support loading plugins and scripts
* Remove CSS rules, allowing Highlight.js theme to be used entirely
* Remove unnecessary webplayer script
2017-10-24 09:45:21 -07:00
Eric Nakagawa
574872d075 Only builds redirect pages if the current file is an english doc (#152) 2017-10-19 16:56:14 -07:00
Eric Nakagawa
a9571ebf4d Removed copy from redirect page, reduced delay to 0s for js and meta 2017-10-19 13:15:05 -07:00