39 Commits

Author SHA1 Message Date
daveoconnor
df330919cc Change boto3 retrieval error from exception to warning (#1956) (#1971) 2025-10-16 11:37:00 -07:00
daveoconnor
086bf942c0 Fix inaccurate content type decoding (#1950) (#1952) 2025-10-08 12:45:51 -07:00
daveoconnor
8088234bf7 Refactor docs retrieval, and canonical uri addition (#1857) (#1924) 2025-09-30 08:42:27 -07:00
Greg Kaleka
30ad9f03f9 Handle caps in redirect meta tag (#1819) 2025-05-29 07:14:19 -04:00
daveoconnor
e2a2caebce Improved error processing (#1590) 2025-01-10 13:19:11 -08:00
Greg Kaleka
b44c1cab6c Render library README code blocks without highlighting; hljs (#1538)
Co-authored-by: Julio Estrada <estradacjulio@gmail.com>
2024-12-11 13:32:19 -05:00
Greg Kaleka
12cfb3a7e9 Fall back to _x filename for beta release notes (#1455) 2024-11-18 13:44:42 -05:00
sdarwin
f80721b0fc Remove fallback url map going to s3 2024-04-12 12:52:40 -04:00
Kenneth Reitz
1ecc2e0ad6 Refactor get_meta_redirect_from_html function to handle case-insensitive URL attribute 2024-04-01 16:00:49 -04:00
Kenneth Reitz
e3eab04467 Add function to extract meta redirect from HTML 2024-04-01 16:00:49 -04:00
Lacey Williams Henschel
6755f76753 Replace relative image URLs with absolute URLs in static content files
- Add function to replace relative image paths with absolute paths
- Add docs on static content and adding shortcuts to the config file
- Add url and view for rendering static image data
2024-02-02 12:24:19 -08:00
Frank Wiles
6d68f294c6 Use static content mapping JSON file from the env
- Addes `STATIC_CONTENT_MAPPING` environment mapping that defaults to
  the current `stage_static_config.json`

- Fixes #725
2023-10-27 08:37:59 -05:00
sdarwin
d67159e3f0 Set STATIC_CONTENT_REGION env variable 2023-10-09 09:00:30 -06:00
Natalia
2c4f8675ce Modernize legacy doc libs pages fetched directly from S3.
This modernization occurs on the fly over potentially-cached S3 files. This
means, the legacy doc pages are fetched and cached just like any other S3
static content, and the modernization happens when the page is requested. This
way, we can safely render modern parts of the pages (like the header) and
account for dynamic state such as logged in users.

The resulting docs (also called FrankenDocs :-)) are processed using
BeautifulSoup and a fairly simple heuristic that can be found in the
`core/htmlhelper.py` module.
2023-07-28 10:13:06 -04:00
Lacey Williams Henschel
825dbc019b Cache asciidoc content in db (Part of #394)
- Add RenderedContent model and related helper methods
- Change StaticContentView `get()` logic to try the cache, then the db, then S3
- Change StaticContentView to update db appropriately
- Refactoring for readability/maintainability
2023-06-09 14:43:05 -07:00
Lacey Williams Henschel
a447ffd7ed Strip footer from asciidoc content (Part of #394) 2023-06-07 14:17:06 -07:00
Lacey Williams Henschel
4e26f55dd1 Extract content of HTML body from rendered asciidoc content (Part of #394)
- Make web service depend on redis
- Add function to extract body from html content
- In view, extract body before returning converted ascciidoc in response
2023-06-07 13:11:20 -07:00
Lacey Williams Henschel
a3cdcf097c Add comments, cleanup 2023-06-06 11:14:50 -07:00
Lacey Williams Henschel
e84b1d1682 Add function to get content type 2023-06-06 11:14:50 -07:00
Natalia
a8cd8f507a Ran pre-commit run -a
Completed runs of black and rest of pre-commit checks.
2023-05-30 23:21:53 -03:00
Lacey Williams Henschel
8cc6b91cf2 Force content type for js fstatic content 2023-05-11 10:05:31 -07:00
Lacey Williams Henschel
8d980068db Improve exception handling and logging 2023-04-18 16:22:48 -07:00
Lacey Williams Henschel
f58d03d4c7 🔈 Add logging 2023-04-18 15:31:05 -07:00
Frank Wiles
a4e1d2b02f Adjust static content paths for /develop/doc/
- Add feature to static site finding that looks for `/index.html` if URL
  ends with a slash
2023-04-14 15:56:19 -05:00
Frank Wiles
d3b417f8ab Adjust static content settings names
Realized we have a conflict in settings names between S3 hosted
static content and S3 hosted uploaded media content. Prefixing
static content with `STATIC_CONTENT_`
2023-04-06 06:09:09 -05:00
Frank Wiles
10fc6c42e5 Small static content fixes
- We don't need to be setting DEFAULT_FILE_STORAGE after static changes

- Need to be able to correctly pass binary files (images, etc) so need
  to avoid converting to UTF-8 after retrieving from S3

- Moved to simpler CBV
2023-04-06 06:00:01 -05:00
Lacey Williams Henschel
4800e7c487 Skip the live API test 2023-04-05 08:59:47 -07:00
Lacey Williams Henschel
83e12164ab Cleanup -- all should work now! 2023-04-05 08:58:18 -07:00
Lacey Williams Henschel
9ad183fa5a 🔧 Add a second config option 2023-04-05 08:18:06 -07:00
Lacey Williams Henschel
23289868cf 🚧 Progress on config for static content
Works now with the most basic setup: replace /site/develop/ with just / in the url
2023-04-05 07:19:45 -07:00
Lacey Williams Henschel
f8138d498f 🚧 Getting back to a working state without config
Includes these failing tests:
```
=============================== short test summary info ================================
FAILED core/tests/test_renderer.py::test_get_s3_keys - AssertionError: assert '/site/develop/tools/auto_index/index.html' in []
FAILED core/tests/test_views.py::test_static_content_template_view[/site/develop/rst.css] - django.http.response.Http404: Page not found
```
2023-04-05 06:40:36 -07:00
Lacey Williams Henschel
8fab4fca68 🚧 Progress on static content 2023-04-04 21:15:45 -07:00
Lacey Williams Henschel
5444e3babe Set the content-type for static content in the response 2023-04-04 12:20:30 -07:00
Lacey Williams Henschel
70b69c56fb 🚧 Hook the Markdown view up to the S3 call 2023-04-04 10:17:39 -07:00
Lacey Williams Henschel
c359f325cd ❄️ Change setting names for AWS 2023-04-04 09:23:04 -07:00
Lacey Williams Henschel
272061508e 🚧 Progress on s3 retrieval 2023-04-03 13:18:21 -07:00
Lacey Williams Henschel
eb213ffba1 WIP: Getting to know boto3 2023-04-03 12:30:33 -07:00
Frank Wiles
a8e9085c2c Fix black formatting 2022-09-28 10:55:51 -05:00
Greg Newman
2487c62d28 🚧 Markdown renderer
* Stubbed out TemplateView for rendering markdown files
* Added a BoostRenderer class to parse the markdown files to support the first iteration of a youtube shortcode and also a Pygments renderer for code blocks.
* Added default styles for some common markup so the rendered markdown looks better.

The pygments renderer is set to use Solarized Dark right now because that’s the closest I see that matches the design of the site.  This can be changed in the class.
2022-09-10 11:07:42 -04:00