From 5adb27d65b3ccc095161d9fd81e34cdea532b33f Mon Sep 17 00:00:00 2001 From: Thorn Walli Date: Tue, 24 Sep 2024 17:14:44 +0200 Subject: [PATCH] fix(update): added usage; improve --- docs/.vitepress/navigation.js | 3 +- docs/src/introduction.md | 37 ++--- docs/src/usage.md | 85 ++++++++++++ playground/src/App.vue | 102 +++++++------- .../components/ArticleContentContainer.vue | 1 - ...ontainer.vue => BasicContentContainer.vue} | 3 +- src/ContentContainer.vue | 4 +- src/useContentContainer.js | 8 +- src/useContentHeadline.js | 4 +- test/contentContainer.test.js | 2 +- test/contentHeadline.test.js | 4 +- test/useContentContainer.test.js | 2 +- test/useContentHeadline.test.js | 130 +++++++++++++++++- 13 files changed, 288 insertions(+), 97 deletions(-) create mode 100644 docs/src/usage.md rename playground/src/components/{DefaultContentContainer.vue => BasicContentContainer.vue} (89%) diff --git a/docs/.vitepress/navigation.js b/docs/.vitepress/navigation.js index e2871e8..6c59f8c 100644 --- a/docs/.vitepress/navigation.js +++ b/docs/.vitepress/navigation.js @@ -10,7 +10,8 @@ export default { text: 'Guide', items: [ { text: 'Introduction', link: '/introduction' }, - { text: 'Setup', link: '/setup' } + { text: 'Setup', link: '/setup' }, + { text: 'Usage', link: '/usage' } ] }, { diff --git a/docs/src/introduction.md b/docs/src/introduction.md index dfaaed3..44f8c50 100644 --- a/docs/src/introduction.md +++ b/docs/src/introduction.md @@ -33,27 +33,22 @@ If `ContentContainer` is level 2, `ContentHeadline` level 2 is rendered as `h2`.
Header
-
+
Primary Headline (h1) -
+ Secondary Headline 1 (h2) - - Tertiary Headline 1.1 (h3) - - - Tertiary Headline 1.2 (h3) - + Tertiary Headline 1.1 (h3) + + + Tertiary Headline 1.2 (h3) -
Secondary Headline 2 (h2) - - Tertiary Headline 2.1 (h3) - + Tertiary Headline 2.1 (h3) @@ -66,26 +61,22 @@ If `ContentContainer` is level 2, `ContentHeadline` level 2 is rendered as `h2`.
Header
-
+

Primary Headline (h1)

-
+

Secondary Headline 1 (h2)

-
-

Tertiary Headline 1.1 (h3)

-
-
-

Tertiary Headline 1.2 (h3)

-
+

Tertiary Headline 1.1 (h3)

+
+
+

Tertiary Headline 1.2 (h3)

Secondary Headline 2 (h2)

-
-

Tertiary Headline 2.1 (h3)

-
+

Tertiary Headline 2.1 (h3)

diff --git a/docs/src/usage.md b/docs/src/usage.md new file mode 100644 index 0000000..68ad986 --- /dev/null +++ b/docs/src/usage.md @@ -0,0 +1,85 @@ +--- +title: Usage +--- + +# {{$frontmatter.title}} + +The standard behavior of `vue-semantic-structure` defines the most common approach for the use of HTML structure components. + +In this structure, the main content contains different modules *(example: Stage (Hero), Text-Image, Gallery, etc.)*. + +The main structure is in the `
` tag, which contains the main components. + +::: code-group + +```html [HTML] +
+
+
+ +
+``` + +```vue [Vue] + +``` + +::: + +## Advance Usage + +The behavior of the `ContentContainer` can also be adapted for blog article pages. + +Here, an `
` is often used in the `
` tag, for which the `ContentContainer` must be adapted. + +The `rootTags` property must be extended by an `
` (e.g. `['main', 'article']`). + +It is recommended to create a separate component that extends the `ContentContainer`. + +### `CustomContentContainer.vue` + +```vue + + + +``` + +In comparison to the basic application, the entire content is enclosed in another `CustomContentContainer` (e.g. `ContentContainer`), which represents the `
` tag. + +::: code-group + +```html [HTML] +
+
+
+
+ +
+
+``` + +```vue [Vue] + +``` + +::: diff --git a/playground/src/App.vue b/playground/src/App.vue index 250dff7..27512e4 100644 --- a/playground/src/App.vue +++ b/playground/src/App.vue @@ -1,6 +1,6 @@