Skip to content

Commit

Permalink
rename and regenerate all pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Integralist committed Jan 26, 2021
1 parent 2671c9f commit d3cb7dc
Show file tree
Hide file tree
Showing 70 changed files with 17 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ resource "aws_security_group" "from_fastly" {
from_port = "443"
to_port = "443"
protocol = "tcp"
cidr_blocks = data.fastly_ip_ranges.fastly.cidr_blocks
ipv6_cidr_blocks = data.fastly_ip_ranges.fastly.ipv6_cidr_blocks
cidr_blocks = ["${data.fastly_ip_ranges.fastly.cidr_blocks}"]
ipv6_cidr_blocks = ["${data.fastly_ip_ranges.fastly.ipv6_cidr_blocks}"]
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: |-
Get information on Fastly WAF rules.
---

-> **Note:** This data source is only available from x.x.x of the Fastly terraform provider.
-> **Note:** This data source is only available from 0.20.0 of the Fastly terraform provider.

# fastly_waf_rules

Expand Down Expand Up @@ -145,4 +145,4 @@ The `rules` block supports:
* `latest_revision_number` - The rule's latest revision.
* `type` - The rule's type.

[1]: https://docs.fastly.com/api/ngwaf#ngwaf_rules
[1]: https://developer.fastly.com/reference/api/waf/rules/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{define "fastly_ip_ranges"}}---
{{define "ip_ranges"}}---
layout: "fastly"
page_title: "Fastly: fastly_ip_ranges"
sidebar_current: "docs-fastly-datasource-ip_ranges"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{define "fastly_waf_rules"}}---
{{define "waf_rules"}}---
layout: "fastly"
page_title: "Fastly: fastly_waf_rules"
sidebar_current: "docs-fastly-datasource-waf_rules"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
32 changes: 11 additions & 21 deletions scripts/website/parse-templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,63 +37,52 @@ func main() {
var dataPages = []Page{
{
name: "ip_ranges",
path: docsDir + "data-sources/ip_ranges.html.markdown",
path: docsDir + "data-sources/ip_ranges.md",
},
{
name: "waf_rules",
path: docsDir + "data-sources/waf_rules.html.markdown",
path: docsDir + "data-sources/waf_rules.md",
},
}

var resourcePages = []Page{
{
name: "service_v1",
path: docsDir + "resources/service_v1.html.markdown",
path: docsDir + "resources/service_v1.md",
Data: PageData{
"vcl",
},
},
{
name: "service_compute",
path: docsDir + "resources/service_compute.html.markdown",
path: docsDir + "resources/service_compute.md",
Data: PageData{
"wasm",
},
},
{
name: "service_dictionary_items_v1",
path: docsDir + "resources/service_dictionary_items_v1.html.markdown",
path: docsDir + "resources/service_dictionary_items_v1.md",
},
{
name: "service_acl_entries_v1",
path: docsDir + "resources/service_acl_entries_v1.html.markdown",
path: docsDir + "resources/service_acl_entries_v1.md",
},
{
name: "service_dynamic_snippet_content_v1",
path: docsDir + "resources/service_dynamic_snippet_content_v1.html.markdown",
path: docsDir + "resources/service_dynamic_snippet_content_v1.md",
},
{
name: "service_waf_configuration",
path: docsDir + "resources/service_waf_configuration.html.markdown",
path: docsDir + "resources/service_waf_configuration.md",
},
{
name: "user_v1",
path: docsDir + "resources/user_v1.html.markdown",
path: docsDir + "resources/user_v1.md",
},
}

// TODO(integralist): redesign the template parsing so that we don't need
// a root node of the pages tree structure. Historically the 'no-op' file
// would have referenced a fastly_erb/fastly.erb file containing a Ruby based
// HTML template file (as the terraform.io used to run on a Ruby platform).
// This file would define the HTML for a side-menu bar that linked to other
// pages and resources.
var pages = append(resourcePages, Page{
name: "no-op",
path: docsDir + "no_op",
DataMenu: generateMenuItems("data-sources", dataPages),
ResourceMenu: generateMenuItems("resources", resourcePages),
})
pages := append(resourcePages, dataPages...)

renderPages(getTemplate(tmplDir), pages)
}
Expand Down Expand Up @@ -136,6 +125,7 @@ func getTemplate(tmplDir string) *template.Template {
}
return nil
})
fmt.Println(templateFiles)
return template.Must(template.ParseFiles(templateFiles...))
}

Expand Down

0 comments on commit d3cb7dc

Please sign in to comment.