Forum Discussion

EthanHaft's avatar
EthanHaft
Copper Contributor
Apr 11, 2025

Handling Raw HTML Webpages

Hi there,

 

My team is trying to figure out if this is possible with Sharepoint:

 

We would like to create a data repository with granular search functionality with legacy data from an Access database. We've exported the database to excel and created a function in Python to parse each record (over 6000) into individual HTML pages that are comparable to a wiki in function.

We have 6000+ HTML files we'd like to host, is there any way to upload them all together as individual web pages? Our understanding at the moment is that in this format, they'd have to be manually embedded into a created page.

Assessing whether or not Sharepoint is capable of this or if we need to host something internally.

Thanks!

1 Reply

  • grant_jenkins's avatar
    grant_jenkins
    Steel Contributor

    I'm not sure hosting the HTML pages as an embed would be a great idea. It might be better spinning up a web server in Azure and hosting the pages.

    As an alternative, have you considered creating SharePoint pages instead of HTML pages? Not sure exactly what you have in your pages, but here's an example of how you would take some CSV data and create a page for each row.

     

    For this example, I just generated three rows for animals including a link to Wikipedia for more info.

     

    And the PowerShell script that creates a page for each animal. You'd just have to change YOUR_TENANT, YOUR_SITE, and YOUR_CLIENT_ID.

    Connect-PnPOnline -Url "https://YOUR_TENANT.sharepoint.com/sites/YOUR_SITE" -ClientId "YOUR_CLIENT_ID" -Interactive
    
    $rows = Import-Csv -Path "C:\Scripts\SPO\PageWebParts\AccessItems.csv"
    
    foreach($row in $rows) {
        #Get values from the current row
        $name = $row.Name
        $description = $row.Description
        $countryOfOrigin = $row.CountryOfOrigin
        $species = $row.Species
        $diet = $row.Diet
        $link = $row.Link
    
        Write-Host "Processing Page: $($name)" -ForegroundColor Yellow
    
        #Add a new page using the name for the page name and title
        $pnpPage = Add-PnPPage -Name $name -Title $name -LayoutType Article -CommentsEnabled:$false
    
        #Add a section to the page
        Add-PnPPageSection -Page $pnpPage.Name -SectionTemplate OneColumn 
    
        #Build up the body using values from the CSV
        $body = @"
            <h4>Description</h4><p>$description</p>
            <h4>Country of Origin</h4><p>$countryOfOrigin</p>
            <h4>Species</h4><p>$species</p>
            <h4>Diet</h4><p>$diet</p>
            <p><a href='$link' target='_blank' title='$name'>More info</a></p>
    "@
    
        #Add a Page Text Part using the body
        $null = Add-PnPPageTextPart -Page $pnpPage.Name -Section 1 -Column 1 -Order 1 -Text $body
        
        #Publish the page
        $pnpPage.Publish()
    }

     

    The final output is shown below (page created for the Brown Bear). You could add as many sections, columns, and webparts as you like depending on your needs.

     

    Might not be what you are looking for, but I thought I'd share it as an alternative.